Click here to Skip to main content
15,879,239 members
Please Sign up or sign in to vote.
2.00/5 (5 votes)
See more:
how to take screen shots of the windows for every 10 seconds. if i click on the button it should take screen shot of the windows continuously for 10 seconds and then it should stop.
Posted
Updated 28-Jun-15 1:20am
v2
Comments
ChrisCreateBoss 12-Feb-15 23:02pm    
Do you want to take a screenshot of all the screen or just of your form?
Srikanth59 12-Feb-15 23:47pm    
i want to take pc screen shots with 5 seconds or 10 seconds like that if click on it should take screen shot
Philippe Mori 12-May-15 12:14pm    
You question has a contradiction in it. Do you stop after 10 seconds or make another capture?
Srikanth59 13-May-15 0:41am    
thanks for reply i got it

Bitmap screenshot = new Bitmap(SystemInformation.VirtualScreen.Width, 
                               SystemInformation.VirtualScreen.Height, 
                               PixelFormat.Format32bppArgb);
Graphics screenGraph = Graphics.FromImage(screenshot);
screenGraph.CopyFromScreen(SystemInformation.VirtualScreen.X, 
                           SystemInformation.VirtualScreen.Y, 
                           0, 
                           0, 
                           SystemInformation.VirtualScreen.Size, 
                           CopyPixelOperation.SourceCopy);

screenshot.Save("Screenshot.png", System.Drawing.Imaging.ImageFormat.Png);


This might cover the entire screen. You can check out this too: [^]

I hope this helps.
 
Share this answer
 
v2
A simple google search screen capture c# codeproject[^] can provide you ton of information on the requested question.
 
Share this answer
 
use timer to get image in every 10 seconds and use the code which is written by Mr. @ChrisCreateBoss
 
Share this answer
 
C#
try
{
    System.Windows.Forms.Timer timer = new System.Windows.Forms.Timer();
    timer.Tick += new EventHandler(timer2_Tick);
    timer.Interval = (100) * (50);
    timer.Enabled = true;
    timer.Start();

    ScreenShots sc = new ScreenShots();
    sc.pictureBox1.Image = system_serveillance.CaptureScreen.GetDesktopImage();

    while(sc.pictureBox1.Image != null)
    {
        sc.pictureBox1.Image.Save("s"+".jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
        sc.pictureBox1.Image = null;
    }
 
Share this answer
 
Make a timer fire every 10 seconds and in the event handler use the Form.ToBitmap() method
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900