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

扶醉桌前 提交于 2020-01-10 03:05:07

问题


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?


回答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?




回答2:


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



来源:https://stackoverflow.com/questions/4840811/how-to-take-screenshot-of-div-from-a-webpage-using-c-sharp-and-asp-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!