off-screen rendering

797 views
Skip to first unread message

Jose

unread,
Feb 6, 2014, 12:33:32 PM2/6/14
to cef...@googlegroups.com
Hi Czarek,

Your library looks promising !

Can you post an example on how to capture the html rendering to a png file ?

Also, when do you plan to support Linux ?

Thanks and regards
Jose

Czarek Tomczak

unread,
Feb 6, 2014, 1:03:18 PM2/6/14
to cef...@googlegroups.com
Hi Jose,

In CEF 1 you could call the GetImage() method on the browser object that would return paint buffer. See this python example. I don't see this method anymore in CEF 3, though I think this is just an oversight. Adding it shouldn't be a problem, these are just two small functions, see the code in CEF 1: GetImage() and GetSize(). Though CEF 3 introduces multi process architecture so things may work a bit different. I've been already contributing several patches to CEF and it was a good experience, so I encourage you to do so. Marshall the author of CEF is very helpful. You can ask on the CEF Forum if you have any problems.

Another solution is to use off-screen rendering (OSR) to capture webpage to an image file. Though this solution won't work in all cases, if you're using windowed rendering by default and want to capture current state of webpage by creating a second browser in OSR mode. Due to scrolling position, ajax/javascript state or others.

The OSR is not yet supported by cef2go. The example is using windowed rendering.

There is another option. You can use Windows API to capture the content of a window. You can obtain inner CEF window handle by calling GetWindow(mainHwnd, GW_CHILD). See some links from google:


Best regards,
Czarek

Czarek Tomczak

unread,
Feb 6, 2014, 1:05:37 PM2/6/14
to cef...@googlegroups.com
On Thursday, February 6, 2014 6:33:32 PM UTC+1, Jose wrote:
Also, when do you plan to support Linux ?


No known schedule as of this moment.

-Czarek
Reply all
Reply to author
Forward
0 new messages