Exemplo n.º 1
0
        private void OnDocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            var browser = (System.Windows.Forms.WebBrowser)sender;

            browser.Width  = _width < 0 ? browser.Document.Body.ScrollRectangle.Size.Width : _width;
            browser.Height = browser.Document.Body.ScrollRectangle.Size.Height;

            browser.Width  += 20;
            browser.Height += 20;

            using (Graphics graphics = browser.CreateGraphics())
            {
                graphics.TextRenderingHint = TextRenderingHint.AntiAliasGridFit;
                using (Bitmap bitmap = new Bitmap(browser.Width - VERT_SCROLLBAR_WIDTH, browser.Height, graphics))
                {
                    Rectangle bounds = new Rectangle(0, 0, bitmap.Width, bitmap.Height);
                    browser.DrawToBitmap(bitmap, bounds);

                    var pathName = Utils2.RandomFilePath(".png");
                    bitmap.Save(pathName, ImageFormat.Png);
                    _imgPathName(pathName);
                }
            }
            browser.Dispose();
        }
Exemplo n.º 2
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            //in order to handle design time problems, handle null value case
            if (value == null)
            {
                return(null);
            }

            return(new SolidColorBrush(Utils2.IntToColor((int)value)));
        }
Exemplo n.º 3
0
        public LoginSessionDlg()
        {
            InitializeComponent();

            DataContext = this;

            //SkinManager.ChangeSkin("GreenSkin.xaml", this.Assets);
            SkinManager.ChangeSkin("Blue2Skin.xaml", this.Resources);

            lblVersion.Content = Utils2.VersionString();
        }
Exemplo n.º 4
0
        public LoginPerson(bool backAvailable)
        {
            InitializeComponent();

            DataContext = this;

            lblVersion.Content = Utils2.VersionString();

            //SkinManager.ChangeSkin("GreenSkin.xaml", this.Assets);
            SkinManager.ChangeSkin("Blue2Skin.xaml", this.Resources);

            if (backAvailable)
            {
                btnBack.Visibility = Visibility.Visible;
            }
            else
            {
                btnBack.Visibility = Visibility.Collapsed;
            }
        }