public static Capture PerformScreenCapture(TabControl.TabControl tab) { ScreenCapture sc = new ScreenCapture(); string filename = DateTime.Now.ToString("yyyy-MM-dd_hh-mm-ss"); string tempFile = System.IO.Path.Combine(CaptureManager.CaptureRoot, string.Format("{0}.png", filename)); using(sc.CaptureControl(tab, tempFile, ImageFormatHandler.ImageFormatTypes.imgPNG)); //System.Diagnostics.Process.Start(tempFile); return null; }
public static Capture PerformScreenCapture(TabControl.TabControl tab) { ScreenCapture sc = new ScreenCapture(); string filename = DateTime.Now.ToString("yyyy-MM-dd_hh-mm-ss"); string tempFile = System.IO.Path.Combine(CaptureManager.CaptureRoot, string.Format("{0}.png", filename)); using (sc.CaptureControl(tab, tempFile, ImageFormatHandler.ImageFormatTypes.imgPNG)); //System.Diagnostics.Process.Start(tempFile); return(null); }
internal static void PerformScreenCapture(Control control, IFavorite favorite) { string name = ResolveFileName(favorite); string formatedDate = DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss"); string filename = String.Format("{0}{1}.png", name, formatedDate); string tempFile = Path.Combine(CaptureRoot, filename); var sc = new ScreenCapture(); Bitmap bmp = sc.CaptureControl(control, tempFile, ImageFormatTypes.imgPNG); if (settings.EnableCaptureToClipboard) { Clipboard.SetImage(bmp); } }
internal static void PerformScreenCapture(TabControl.TabControl tab) { var activeTab = tab.SelectedItem as TerminalTabControlItem; string name = string.Empty; if (activeTab != null && activeTab.Favorite != null && !string.IsNullOrEmpty(activeTab.Favorite.Name)) { name = activeTab.Favorite.Name + "-"; } string filename = DateTime.Now.ToString("yyyy_MM_dd_hh_mm_ss"); string tempFile = Path.Combine(CaptureRoot, string.Format("{0}{1}.png", name, filename)); ScreenCapture sc = new ScreenCapture(); Bitmap bmp = sc.CaptureControl(tab, tempFile, ImageFormatTypes.imgPNG); if (settings.EnableCaptureToClipboard) Clipboard.SetImage(bmp); }