本文介绍了WebBrowser.DrawtoBitmap()产生空白影像的几个网站一致的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的单独的STA线程asp.net页面的运行一直使用WebBrowser.DrawtoBitmap()来捕获网页为图像。但是我发现我越来越空白影像的几个网站一致。我知道这种方法是不是'正式'的支持,但它会很高兴,如果有人能提供给我任何理由或为这些空白影像问题,周围的工作。

I've been using WebBrowser.DrawtoBitmap() in my asp.net page running in separate STA thread to capture web pages as an image. But I found that I'm getting blank images for few sites consistently. I'm aware that the method is not 'officially' supported but it would be nice if someone can provide me any reason or a work around for these blank images issue.

推荐答案

DrawToBitmap 有一些限制,不总是按预期工作。而是尝试与本地GDI +工作

DrawToBitmap has limitations and dont always work as expected. Try instead work with native GDI+

下面是example

这篇关于WebBrowser.DrawtoBitmap()产生空白影像的几个网站一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-24 16:42