Detect actual size of HTML content in the WebBrowser control

.net, c#, webbrowser-control

Solution

I believe you can get it from the following property:

myWebBrowser.Document.ScrollRectangle.Size;

Being a `System.Drawing.Size` object.

Problem

Is there any way to detect the contents height/width in the WebBrowser control? I'd like to save the contents to an image but only at the size of the actual contents. Thank you in advance.

Original source