How to take screenshot of div from a webpage using C# and ASP.NET?

I would like to create dynamic images from html that I’m generating on website. I have code that generates a PSN Trophy Card, ab Xbox LIVE Gamer Card, a Steam Gamer Card, and an Xfire Gamer Card. Each card is put into its own div and built dynamically from server side code. Is there a way to capture a screenshot of a selected div on a webpage using C# and ASP.NET?

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

If you need to take a screenshot you will need to do so client side. So you will need to do so using some client side tecnology like javascript, flash, silverlight… Asp.net runs on the server so it is ruled out.

Here are some links to other related SO questions about taking a screenshot with javascript:

JavaScript code to take a screenshot of a website without using ActiveX

Take a screenshot of a webpage with JavaScript?

Method 2

You’d need some page rendering library or service. Litmus is one such service I’ve heard about. You might start there.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x