Capture DeskTop Screen

//Add thid Name Space to your Class File

using System.Drawing.Imaging;
using System.Drawing;

////Add Button Control and Chaange Button name as"btnCapture" and paste this coding

Bitmap Bitmap;
Graphics Graps;

Bitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, PixelFormat.Format32bppArgb);
Graps = Graphics.FromImage(Bitmap);
Graps.CopyFromScreen(Screen.PrimaryScreen.Bounds.X, Screen.PrimaryScreen.Bounds.Y,0,0,Screen.PrimaryScreen.Bounds.Size, CopyPixelOperation.SourceCopy);
Bitmap.Save(System.Environment.GetFolderPath(Environment.SpecialFolder.Desktop )+"\\YourShot.jpeg" , ImageFormat.Jpeg);
MessageBox.Show("Your Screen Shot Save in Desktop");


Author: vijetha20 May 2008 Member Level: Gold   Points : 2

i did not understood what is the purpose of capturing desktop screen,what the output i will get