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);
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
            }
        }
Exemple #4
0
        public static Bitmap CaptureScreenshot()
        {
            var screenCapture = new ScreenCapture();

            return(screenCapture.CaptureScreenShot());
        }
Exemple #5
0
 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>());
 }