SharePoint

Screenshot of Web Page C#

Now there are certain people coming up with a requirement where the want to take a screenshot of a web part or a web page.

here is a sample code:

The code is ready. Just you have to do the following steps.

  1. Right click the project name
  2. Add reference -> .net tab and then choose system.windows.forms namespace then press OK button.
  3. In .aspx code behind file you have to import the System.Windows.Forms namespace and that’s it.

By customizing parameters used in CopyFromScreen() function, you can figure out how to capture the small portion of the screen, if required. Create a folder and give folder path in c# code just like above i have given. You can customize the code as well and give the dynamic name of bitmap file every time it is generated.

local_offerevent_note

account_box dsouzajoel30


local_offer

Leave a Reply