Click here to Skip to main content
15,893,266 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I have a web page which shows the reports of various parameters as a Chart.It is a daywise report.I have 20 charts in a single webpage.Now I want the screenshot of this report page and save it as a pdf dynamically from code behind.Can anyone help me on this by giving a solution or a sample application.

Thanks!
Posted

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!!!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900