Capture screenshot of a webpage and get Image (ASP.NET)

我的梦境 提交于 2019-12-06 02:19:11

问题


I'm doing complex html operations on images (drag & drop) and when I'm done, I need to take the screenshot of the page and get the taken image save it on server (virtual dir).

So what I need is

Image img = CaptureURL("www.a.com/b.aspx");

Does anyone know of a library that could help me do this?

Thank you


回答1:


One solution is to use the WebBrowser control and render the result on a bitmap.

Here is the full solution, I think is simple and fast.

http://pietschsoft.com/post/2008/07/c-generate-webpage-thumbmail-screenshot-image.aspx

Other way is to use the IECapt that is a capture utility that can run on server and you can call it from your pages using the Process.Start.

here is the second solution.

http://codegod.org/WebAppCodeGod/Screenshot-of-Webpage-with-ASP-NET-AID398.aspx

And there is the javascript way, that your user render the page on the client side and send you the image. See some examples here : http://hertzen.com/experiments/jsfeedback/ and the source code is here: http://html2canvas.hertzen.com/

Hope this help



来源:https://stackoverflow.com/questions/7362191/capture-screenshot-of-a-webpage-and-get-image-asp-net

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