1
Answer

i tried this code but it is not working

narasiman rao

narasiman rao

9y
336
1
 
 I am capturing the webpage as screen shot and save the screen shot in folder.

Capture image code as follows

protected void btnCapture_Click(object sender, EventArgs e)
{
Bitmap bitmap = new Bitmap
(System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height);

Graphics graphics = Graphics.FromImage(bitmap as System.Drawing.Image);
graphics.CopyFromScreen(0, 0, 0, 0, bitmap.Size);

bitmap.Save(Server.MapPath(@"File\ScreenShot.bmp"), ImageFormat.Bmp);
}


But when i run the above code shows error as follows

A generic error occurred in GDI+.

please kindly help me what is the problem in my above code. 
Answers (1)