C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Tips » Web Development »

Code to Get a snap shot of window using c#.net


Posted Date: 26 Oct 2009    Resource Type: Tips    Category: Web Development
Author: vijayanandhMember Level: Bronze    
Rating: 1 out of 5Points: 3



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..



Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Window  .  Snap Short of window  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Dynamically add or delete a row when inputting data
Previous Resource: Achieve checking multiple selections and batch deletions in row input report
Return to Discussion Resource Index
Post New Resource
Category: Web Development


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use