narasiman rao

narasiman rao

  • NA
  • 519
  • 767k

how to take screenshot of webpage in asp

Oct 9 2015 11:15 AM
 My 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("E:/ScreenShot.bmp",ImageFormat.Bmp);
}


When i run the above code and click the capture button the whole default.aspx page is not displaying.

Im run mode as follows

SNO textbox1
Name textbox2
Age textbox3
ID textbox4
DOB textbox5
Address textbox6
Place textbxo7
State Dropdownlist1
Pincode textbox8
Mobile textbox9
Father Name textbox10
Mother Name textbox11
Permanent Address textbox12

But when i take screen shot in E folder it save as follows

SNO textbox1
Name textbox2
Age textbox3
ID textbox4
DOB textbox5
Address textbox6
Place textbxo7
State Dropdownlist1

The remaining three as follows
Pincode textbox8
Mobile textbox9
Father Name textbox10
Mother Name textbox11
Permanent Address textbox12


The above three is not displaying in E folder the whole screen is not displaying.

From my above code what is the mistake i made please help me. 

Answers (2)