Off-screen rendering resize (CEF3, Windows 10)

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.

Off-screen rendering resize (CEF3, Windows 10)

Postby callumw » Wed Nov 14, 2018 6:28 am

Hi all,

I'm having an issue with resizing a window whilst using off screen rendering. When I resize the screen the webpage scales down rather than adjusting the layout like Chrome would, see images here https://imgur.com/a/lID7YVq for examples of what I mean.

I'm successfully re-sizing my DirectX surfaces, I call CefBrowserHost::WasResized(), I hand CEF the correct size of the drawable area when CefRenderHandler::GetViewRect is called.

I have also tried adding a call to CefBrowserHost::NotifyScreenInfoChanged() and then setting screen_info.rect to the window size and screen_info.available_rect to the drawable area size but this seems to have no effect.

I've verified that the width and height are correct in the OnPaint call, therefore, CEF knows that the resize has happened, it just seems to be re-scaling the content rather than adjusting the webpage layout.

Could anyone here point me in the right direction please? I've searched through the forums here and googled it but I can't find anything.

Thanks
callumw
Newbie
 
Posts: 1
Joined: Wed Nov 14, 2018 5:52 am

Re: Off-screen rendering resize (CEF3, Windows 10)

Postby magreenblatt » Wed Nov 14, 2018 10:53 am

You need to set the correct device scale factor using CefScreenInfo.device_scale_factor returned from CefRenderHandler::GetScreenInfo. See example usage in cefclient.
magreenblatt
Site Admin
 
Posts: 12404
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 34 guests