benshepherd

Capture fullscreen

Apr 4th, 2013
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.56 KB | None | 0 0
  1.         private void CapFullscreen()
  2.         {
  3.             var image = ScreenCapture.Fullscreen();
  4.             string file = Path.GetTempFileName().Replace(".tmp",".png");
  5.  
  6.             try
  7.             {
  8.                 image.Save(file, System.Drawing.Imaging.ImageFormat.Png);
  9.                 System.Diagnostics.Process.Start(file);
  10.             }
  11.             catch (Exception ex)
  12.             {
  13.                 MessageBox.Show(ex.Message, "Fatal error");
  14.             }
  15.             finally
  16.             {
  17.                 image.Dispose();
  18.             }
  19.         }
Advertisement
Add Comment
Please, Sign In to add comment