get raw canvas pixel of browser

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

get raw canvas pixel of browser

Postby hien » Mon Nov 10, 2014 3:20 am

I am hitting an issue where the "final" OnPaint() event containing the pixel data for the whole page is extremely delayed. If I wait long enough (sometime a whole second), then I will eventually get it. Ideally I would like to know exactly when the final pixel buffer is painted. I have already received the OnLoadEnd() event, so I know the page has already finished loading whatever the semantic for that is. Does CEF provide an interface to access the raw pixel data instead of relying on the OnPaint() event.
hien
Newbie
 
Posts: 9
Joined: Mon Nov 03, 2014 9:38 pm

Re: get raw canvas pixel of browser

Postby magreenblatt » Mon Nov 10, 2014 11:07 am

CEF delivers OnPaint notifications when something changes. There is no concept of a "final" OnPaint, but you can trigger an OnPaint by calling CefBrowserHost::Invalidate.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: get raw canvas pixel of browser

Postby hien » Fri Nov 14, 2014 7:58 pm

What does OnLoadEnd() guarantee? It is a bit frustrating that I have to add an arbitrary wait time after OnLoadEnd() to get the pixel buffer containing the image for the whole page. I tried calling Invalidate() after an OnLoadEnd(), but that doesn't necessarily give me a valid pixel buffer on the next OnPain() event.

Is there a way for me to know when the page has finished rendering?
hien
Newbie
 
Posts: 9
Joined: Mon Nov 03, 2014 9:38 pm

Re: get raw canvas pixel of browser

Postby magreenblatt » Sat Nov 15, 2014 12:35 am

How do you define "finished rendering"? Async JS timers, etc, can mutate the DOM forever even after the "onload" event has fired.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: get raw canvas pixel of browser

Postby hien » Sat Nov 15, 2014 5:15 am

Given that the page does not have any javascript, I expect finished rendering means the page has loaded and rendered all resources that are defined based on the given html.
hien
Newbie
 
Posts: 9
Joined: Mon Nov 03, 2014 9:38 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 64 guests