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(); }
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))); }
public LoginSessionDlg() { InitializeComponent(); DataContext = this; //SkinManager.ChangeSkin("GreenSkin.xaml", this.Assets); SkinManager.ChangeSkin("Blue2Skin.xaml", this.Resources); lblVersion.Content = Utils2.VersionString(); }
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; } }