http://www.developerfusion.com/code/4630/capture-a-screen-shot/[
^]
the above link is very useful.I used
CaptureScreen() method from the above mentioned link and created image and passed that image to the following code which creates the screen shot
Bitmap bitmap = new Bitmap(
CaptureScreen());
Graphics graphics = Graphics.FromImage(bitmap as System.Drawing.Image);
graphics.CopyFromScreen(0, 0, 0, 0, bitmap.Size);
bitmap.Save("
c:\\screenshot.jpeg", ImageFormat.Jpeg);
It will create the image in the path mentioned.
Enjoy!!!