Page 1 of 1

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

PostPosted: Fri Jul 30, 2021 3:55 am
by wangying666
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.

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

PostPosted: Fri Jul 30, 2021 1:26 pm
by magreenblatt
Did you test with `cefclient --off-screen-rendering-enabled`? You need to implement the CefRenderHandler::GetScreenInfo method and set CefScreenInfo.device_scale_factor.

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

PostPosted: Sun Aug 01, 2021 4:07 am
by wangying666
It's works fine, thanks!

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

PostPosted: Sun Aug 01, 2021 4:33 am
by wangying666
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.

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

PostPosted: Sun Aug 01, 2021 10:20 am
by magreenblatt
Using SendKeyEvent is the only option. See usage in cefclient.