Created
September 9, 2018 09:57
-
-
Save bezysoftware/2e68dccb31d88ed8cd224399914ac21b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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