There are a lot threads about this but none of them were clear and none I tried actually even worked right.
What is the code to get the contents of the entire web browser control (even that which is off screen)?
It looks like they did have:
webBrowser1.DrawToBitmap(); // but its unsupported and doesnt work
Try to make sure you are calling the method in the DocumentCompleted
event.
webBrowser1.Width = wb.Document.Body.ScrollRectangle.Width;
webBrowser1.Height = wb.Document.Body.ScrollRectangle.Height;
Bitmap bitmap = new Bitmap(webBrowser1.Width, webBrowser1.Height);
webBrowser1.DrawToBitmap(bitmap, new Rectangle(0, 0, webBrowser1.Width, webBrowser1.Height));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With