Friday 11 December 2015

Take Screen Shot Of Page

  1. using System;  
  2. using System.Drawing;  
  3. using System.Drawing.Imaging;  
  4. using System.Windows.Forms; 



  1. public static void Capture(string CapturedFilePath)  
  2.       {  
  3.          Bitmap bitmap = new Bitmap  
  4.        (Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);  
  5.   
  6.           Graphics graphics = Graphics.FromImage(bitmap as System.Drawing.Image);  
  7.           graphics.CopyFromScreen(25, 25, 25, 25, bitmap.Size);  
  8.           
  9.           bitmap.Save(CapturedFilePath, ImageFormat.Bmp);  
  10.       }  





  1. protected void Button1_Click(object sender, EventArgs e)  
  2.        {  
  3.            Capture( "E:/ScreenShot.bmp");//path to Save Captured files  
  4.        } 

No comments: