/// <summary> /// Captures a screenshot of the entire desktop and returns the bitmap /// </summary> public static Bitmap CaptureScreenshot() { var screenCapture = new ScreenCapture(); return screenCapture.CaptureDesktop(); }
// ReSharper disable once UnusedMember.Local private void SaveScreenshotToArtifacsDir(string suffix) { var fileName = System.IO.Path.Combine(Info.ArtifactsDirectory(), $"{this.WindowName}_{suffix}.png"); using (var image = new TestStack.White.ScreenCapture().CaptureDesktop()) { image.Save(fileName); } }
/// <summary> /// Captures a screenshot of the provided boundary and returns the bitmap /// </summary> /// <param name="bounds">Screen rectangle to capture</param> public static Bitmap CaptureScreenshot(Rect bounds) { var screenCapture = new ScreenCapture(); return screenCapture.CaptureArea(bounds); }
/// <summary> /// Captures a screenshot of the provided boundary and returns the bitmap /// </summary> /// <param name="bounds">Screen rectangle to capture</param> public static Bitmap CaptureScreenshot(Rect bounds) { var screenCapture = new ScreenCapture(); return(screenCapture.CaptureArea(bounds)); }
/// <summary> /// Captures a screenshot of the entire desktop and returns the bitmap /// </summary> public static Bitmap CaptureScreenshot() { var screenCapture = new ScreenCapture(); return(screenCapture.CaptureDesktop()); }