Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Drawing;
- using System.Threading;
- using System.Windows.Forms;
- namespace TestApp
- {
- class Program
- {
- static void Main(string[] args)
- {
- var i = 0;
- while (true)
- {
- TakeScreenShot(i);
- i++;
- Thread.Sleep(1000 * 30);
- }
- }
- private static void TakeScreenShot(int i)
- {
- using (var bmp = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height))
- {
- using (Graphics g = Graphics.FromImage(bmp))
- {
- g.CopyFromScreen(0, 0, 0, 0, Screen.PrimaryScreen.Bounds.Size);
- bmp.Save($@"C:\Users\furio\OneDrive\podbel\podbel{i}.png"); // saves the image
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement