0

Is there a way to obtain a bitmap rendering of a Windows Forms control, specifically a WebBrowser, upon creating an instance, but not adding it to a visible form? A mechanism like WPF's measure & arrange that would allow me to render it to a bitmap.

I'm targetting .NET 4.0 and looking for a way to capture the WebBrowser control's contents without ever displaying it.

luvieere
  • 37,065
  • 18
  • 127
  • 179

1 Answers1

0

See this question: WebBrowser.DrawToBitmap() or other methods?

Community
  • 1
  • 1
stuartd
  • 70,509
  • 14
  • 132
  • 163
  • The DrawToBitmap doesn't perform very well with websites that contain flash (captures only the section down to the flash movie) and the native GDI+ method only works with visible, displayed components. – luvieere May 13 '11 at 15:31
  • I managed to use DrawToBitmap after all, as long as I don't click the control, it manages to capture the image fine. – luvieere May 14 '11 at 13:55