Search code examples
c++direct3dmshtml

How to create a direct3d texture of a web page rendered by MSHTML in C++?


I have integrated a web page inside my native C++ Application through MSHTML (Microsoft Rendering engine of IE).

What I want to do now is to generate a LPDIRECT3DTEXTURE9 (Direct3d texture) of the displayed web page.

Is it possible ? Do you know how to ?

Thanks in advance for all your answers.


Solution

  • Do you need to capture the 'visible' portion of a rendered webpage, or the entire webpage, regardless of length/width?

    If its the latter, Rob Manderson wrote a good article on achieving this with the IHTMLElementRender interface. His article can be found here: http://www.codeproject.com/KB/IP/htmlimagecapture.aspx

    If you're simply interested in 'window capturing' a bitmap of what would be visible in a browser window, you can get hold of the window's HDC, call BitBlt() to copy the contents out.