Does anyone know how I get the full page height and width in GeckoFX? In the IE WebBrowser object, I ca开发者_开发百科n look at WebBrowser.Document.Body.ScrollRectangle. (The objective here is to take a screenshot of the entire page)
Thanks!
I'm using Hindle's fork of GeckoFX, and here's how I do it:
var width = _browser.Document.ActiveElement.ScrollWidth;
var height = _browser.Document.ActiveElement.ScrollHeight;
I use this to create thumbnails of the page. Note, this gives us the size taken up by the first page we navigated to, not necessarily the size of the current page. I get around that by using different browser instances for each page I'm thumbnailing.
I did this:
BROWSER = new GeckoWebBrowser();
BROWSER.Height = 1920;
BROWSER.Width = 1080;
It seems working.
Visual Studio installed: Community 2019
GeckoFx installed: v45.0.34 (with NuGet package manager)
精彩评论