Skip to content

Instantly share code, notes, and snippets.

@bezysoftware
Created September 9, 2018 09:57
Show Gist options
  • Select an option

  • Save bezysoftware/2e68dccb31d88ed8cd224399914ac21b to your computer and use it in GitHub Desktop.

Select an option

Save bezysoftware/2e68dccb31d88ed8cd224399914ac21b to your computer and use it in GitHub Desktop.
private void Screenshot(int order, string lng)
{
float scale = 1.75f;
var size = new Size((int)(Screen.PrimaryScreen.WorkingArea.Width * scale), (int)(Screen.PrimaryScreen.WorkingArea.Height * scale));
using (var bitmap = new Bitmap(size.Width, size.Height))
{
using (var g = Graphics.FromImage(bitmap))
{
g.CopyFromScreen(Screen.PrimaryScreen.WorkingArea.X,
Screen.PrimaryScreen.WorkingArea.Y,
0,
0,
size,
CopyPixelOperation.SourceCopy);
Directory.CreateDirectory($@"c:\screenshots\{lng}\");
bitmap.Save($@"c:\screenshots\{lng}\screenshot{order}.png", ImageFormat.Png);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment