Get snap shot of window
using System.Drawing; using System.IO; using System.Text; //file name is created based on a time File_name.Text = System.DateTime.Now.ToShortTimeString(); string file_name = File_name.Text.Replace(':', '-'); Bitmap image = new Bitmap(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(image); graphics.CopyFromScreen(System.Windows.Forms.Screen.PrimaryScreen.Bounds.X, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Y, 0, 0, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Size, System.Drawing.CopyPixelOperation.SourceCopy); image.Save("C:/temp/" + file_name.ToString()+".jpg");
Note:
If you want to take a snap shot for particualr timer interval, just add a meta-tag inside head tag
meta http-equiv="refresh" content="60"
60 refers the page refreshing time in a seconds..
|
No responses found. Be the first to respond and make money from revenue sharing program.
|