GeckoFX WebBrowser页面的高度和宽度 [英] GeckoFX WebBrowser page height and width

查看:155
本文介绍了GeckoFX WebBrowser页面的高度和宽度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道我如何在GeckoFX中获得整个页面的高度和宽度吗? 在IE WebBrowser对象中,我可以查看WebBrowser.Document.Body.ScrollRectangle. (这里的目的是拍摄整个页面的屏幕截图)

Does anyone know how I get the full page height and width in GeckoFX? In the IE WebBrowser object, I can look at WebBrowser.Document.Body.ScrollRectangle. (The objective here is to take a screenshot of the entire page)

谢谢!

推荐答案

我正在使用 Hindle的叉子的GeckoFX,这是我的操作方法:

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;

我用它来创建页面的缩略图.请注意,这为我们提供了导航到的 first 页面所占用的大小,而不一定是 current 页面的大小.通过为要缩略图显示的每个页面使用不同的浏览器实例,可以解决此问题.

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.

这篇关于GeckoFX WebBrowser页面的高度和宽度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆