private void MakeAScreenShot(object obj) { ScreenCapture screenCapture = new ScreenCapture(); Image image = screenCapture.CaptureScreenShot(); string imageName = System.DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss"); image.Save(@$ "C:\Users\ЗейноллаД\Pictures\ZeinollaD\{imageName}.png", ImageFormat.Png);
public void TakeScreenShot() { ScreenCapture sc = new ScreenCapture(); // capture entire screen, and save it to a file Bitmap img = sc.CaptureScreenShot(); img.Save("test.jpg", ImageFormat.Jpeg); }
public void ScreenShot(String path) { try { var sc = new ScreenCapture(); var bitmap = sc.CaptureScreenShot(); bitmap.Save(@path, ImageFormat.Png); } catch (Exception e) { Console.WriteLine("ScreenShot:" + e.Message); } }
public static Bitmap CaptureScreenshot() { var screenCapture = new ScreenCapture(); return(screenCapture.CaptureScreenShot()); }
public void CaptureScreenshot_OnCapture_GeneratesScreenshot() { ScreenCapture.CaptureScreenShot(_fileService, "screenshot_1.png"); _fileService.Received(1).SaveImage("screenshot_1.png", Arg.Any <System.Drawing.Bitmap>(), Arg.Any <System.Drawing.Imaging.ImageFormat>()); }