Example #1
1
 /// <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);
     }
 }
Example #3
0
 // 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);
     }
 }
Example #4
0
 /// <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);
 }
Example #5
0
        /// <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));
        }
Example #6
0
        /// <summary>
        /// Captures a screenshot of the entire desktop and returns the bitmap
        /// </summary>
        public static Bitmap CaptureScreenshot()
        {
            var screenCapture = new ScreenCapture();

            return(screenCapture.CaptureDesktop());
        }