Search code examples
c#asp.netscreenshotdrawtobitmap

WebBrowser.DrawtoBitmap() generating blank images for few sites consistently


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.


Solution

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

    Here is example