Skip to content

Instantly share code, notes, and snippets.

@DexterHaslem
Created October 30, 2013 22:52
Show Gist options
  • Save DexterHaslem/7241690 to your computer and use it in GitHub Desktop.
Save DexterHaslem/7241690 to your computer and use it in GitHub Desktop.
Action grabScreenshot = () =>
{
using (Bitmap bitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height))
using (Graphics graphics = Graphics.FromImage(bitmap))
{
graphics.CopyFromScreen(0, 0, 0, 0, bitmap.Size);
string fileName = "urc00luniquefilenamehere.jpeg";
bitmap.Save(fileName, ImageFormat.Jpeg);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment