将 WebBrowser.Document 转换为位图?
是否可以将 WebBrowser.Document 绘制为位图?基本上是对 WebBrowser 控件进行屏幕截图(请注意,这是一个不存在于表单中而仅存在于代码中的 WebBrowser)。
WebBrowser w = new WebBrowser();
w.Document = "<b>Hello</b> world.";
w.Document.DrawToBitmap ???
谢谢!
Is it possible to draw a WebBrowser.Document to a Bitmap? Basically taking a screenshot of a WebBrowser control (note, this is with a WebBrowser that doesn't live on a form, but just in code).
WebBrowser w = new WebBrowser();
w.Document = "<b>Hello</b> world.";
w.Document.DrawToBitmap ???
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我使用以下代码捕获 WebBrowser 控件中加载的网页的屏幕截图:
示例:
I use the following code to capture a screenshot of a web page loaded in a WebBrowser control:
Example:
http://www.bryancook.net/2006/03 /screen-capture-for-invisible-windows.html
和此处:
http: //www.codeproject.com/KB/graphics/screen_capturing.aspx
我相信您应该获取 WebBrowser 控件的句柄并将其内容保存为图像,如这些链接中建议的那样。
http://www.bryancook.net/2006/03/screen-capture-for-invisible-windows.html
and here:
http://www.codeproject.com/KB/graphics/screen_capturing.aspx
I believe you should get the handle of your WebBrowser control and save it's content as image like suggested in those links.