Off-screen-rendering seems not support high-dpi on windows.

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 seems not support high-dpi on windows.

Postby wangying666 » Fri Jul 30, 2021 3:55 am

The off-screen-rendering mode just like the attachment "off-screen-rendering.png" shown, and the default window rendering mode's like the "window.png" shown. The window rendering mode's resolution is higher than off-screen-rendering mode.

I need to support high-dpi on windows when use off-screen-rendering mode, and try to use CefEnableHighDPISupport、SetRoomLevel、"--force-device-scale-factor", "2", but all of those did not work.

So is there a solution supported high-dpi on off-screen-rendering mode?

My OS version is windows 10.

thanks.
Attachments
window.png
window.png (69.87 KiB) Viewed 259 times
off-screen-rendering.png
off-screen-rendering.png (105.3 KiB) Viewed 259 times
wangying666
Newbie
 
Posts: 3
Joined: Fri Jul 30, 2021 3:23 am

Re: Off-screen-rendering seems not support high-dpi on windo

Postby magreenblatt » Fri Jul 30, 2021 1:26 pm

Did you test with `cefclient --off-screen-rendering-enabled`? You need to implement the CefRenderHandler::GetScreenInfo method and set CefScreenInfo.device_scale_factor.
magreenblatt
Site Admin
 
Posts: 11088
Joined: Fri May 29, 2009 6:57 pm

Re: Off-screen-rendering seems not support high-dpi on windo

Postby wangying666 » Sun Aug 01, 2021 4:07 am

It's works fine, thanks!
wangying666
Newbie
 
Posts: 3
Joined: Fri Jul 30, 2021 3:23 am

Re: Off-screen-rendering seems not support high-dpi on windo

Postby wangying666 » Sun Aug 01, 2021 4:33 am

And there is another question. Are there any best practices for keyboard input on off-screen-rendering mode? if we hook keyboard event and call SendKeyEvent to send event to CEF directly, which seems difficult to handle modifiers、 language switch, and so on.

thanks.
wangying666
Newbie
 
Posts: 3
Joined: Fri Jul 30, 2021 3:23 am

Re: Off-screen-rendering seems not support high-dpi on windo

Postby magreenblatt » Sun Aug 01, 2021 10:20 am

Using SendKeyEvent is the only option. See usage in cefclient.
magreenblatt
Site Admin
 
Posts: 11088
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: colinChan008, Google [Bot] and 18 guests