I have two questions:
1. How can I take screenshot after every 1 min, when a key is pressed E.g.
- 10:00: -> key pressed -> Img1
- 10:01: -> key pressed -> Img2
- 10:02: -> key pressed -> Img3
2. How can I iterate the image chain assuming my program runs for 5-10 mins
string ImgPath = @"D:\"Img" + iteration + ".bmp";
Bitmap btmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
Graphics g = Graphics.FromImage(btmp);
g.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y, 0, 0, btmp.Size, CopyPixelOperation.SourceCopy);
if (any key is pressed)
if (time difference is 1 min)
btmp.Save(ImgPath, System.Drawing.Imaging.ImageFormat.Bmp);
Also if there is a more better way to take screenshot please share here.
Thanks!