如何使用IViewObject :: Draw来渲染canvas的可滚动区域? [英] How do I render the scrollable regions of a canvas with IViewObject::Draw?

查看:390
本文介绍了如何使用IViewObject :: Draw来渲染canvas的可滚动区域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在试图渲染整个画布在IWebBrowser2控件到位图。 IViewObject :: Draw似乎是最有前途的方法,但我不能让它渲染任何需要滚动显示。虽然我可以自动滚动和缝合图像在一起,这对于任何固定位置元素看起来怪异。这是否是可行的?

I've been trying to render the entire canvas in an IWebBrowser2 control to a bitmap. IViewObject::Draw seems to be the most promising approach, but I can't get it to render anything that would requires a scroll to show. While I could automate the scrolling and stitch the images together, this would look weird with any fixed position elements. Is this even doable?

此外,我试图将控制器的大小设置为允许显示整个内容,而不需要滚动,但Windows最大尺寸到当前屏幕分辨率,这样只有部分在那里。

Additionally, I've tried to set the controller's size to one that would allow the entire contents to display without needing to scroll, but Windows caps the max size to the current screen resolution, so that only gets me partially there.

任何帮助将非常感激。我现在在Win7和IE8的上下文中这样做,但我不认为这应该是很重要。

Any help would be much appreciated. I'm currently doing this in the context of Win7 and IE8, but I don't think that should matter much.

推荐答案

对不起,我花了这么长时间跟进这个答案。

Sorry it took so long for me to follow up with the answer to this.

我写了一篇文章,详细介绍如何欺骗Windows允许您调整窗口大于虚拟屏幕分辨率,允许像PrintWindow或IViewObject :: Draw这样的功能捕获整个客户区(即浏览器画布)。

I wrote up an article detailing how to trick Windows into allowing you to resize a window larger than the virtual screen resolution, allowing functions like PrintWindow or IViewObject::Draw to capture the entire client area (i.e., the browser canvas).

http://nirvdrum.com /2010/03/25/how-to-take-full-page-or-full-canvas-screenshots-in-windows.html

一该技术的实际实现可以在我的在GitHub(username:nirvdrum)的SnapsIE存储库中找到。不幸的是,我没有足够的业力发布两个超链接。存储库通过文章链接。

An actual implementation of the technique can be found in my SnapsIE repository on GitHub (username: nirvdrum). Unfortunately I don't have enough karma to post two hyperlinks. The repository is linked from the article though.

这篇关于如何使用IViewObject :: Draw来渲染canvas的可滚动区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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