How to render scrollable canvas areas using IViewObject :: Draw?

I am trying to make the entire canvas in the IWebBrowser2 control bitmap. IViewObject :: Draw seems the most promising, but I can't get it to display anything that needs scrolling. Although I could automate scrolling and stitch images together, it would look weird with any elements of a fixed position. Is it even doable?

In addition, I tried to set the size of the controller to one that would allow all content to be displayed without the need for scrolling, but Windows closes the maximum size to the current screen resolution, so it partially changes me there.

Any help would be greatly appreciated. I am currently doing this in the context of Win7 and IE8, but I do not think this should make a big difference.

+3
winapi com
source share
2 answers

Sorry, it took me so long to answer this question.

I wrote an article detailing how to trick Windows so that you can resize the window more than the resolution of the virtual screen, allowing features like PrintWindow or IViewObject :: Draw to capture the entire client area (i.e. browser canvas) .

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

The actual implementation of the method can be found in my SnapsIE repository on GitHub (username: nirvdrum). Unfortunately, I don’t have enough karma to publish two hyperlinks. However, the repository is associated with this article.

+2
source share

It is very likely that optimizing IE will not attract more than required. Perhaps you can scroll the window and call IViewObject :: Draw in a loop without any animation?

I am surprised that Windows closes the maximum size to the current screen resolution. Are you sure about that?

0
source share

All Articles