What is the mapping between DPI values and Zoom Levels (0,1,2..etc) when using the setZoomLevel()

171 views
Skip to first unread message

Charith Wijenayake

unread,
Aug 31, 2015, 2:03:24 AM8/31/15
to CefSharp
Hi,

I am using the cefSharp library in a c# project where the chrome browser instance is used to display a web page. I need to set the zoom level of the browser depending on my system resolution (dpi value). Does anyone know the mapping between the dpi levels and the Zoom level in setZoomLevel() method? 
eg -: 
  • 96 DPI = 100% scaling  [should this be setZoomLevel(0.0) ??]
  • 120 DPI = 125% scaling  [should this be setZoomLevel(1.0) or  setZoomLevel(2.0)??]
Thank you.

Alex Maitland

unread,
Aug 31, 2015, 4:12:53 AM8/31/15
to CefSharp
The CEF API doesn't really have much information on the subject. It only says that 0.0 is zoom rest.

https://bitbucket.org/chromiumembedded/cef/src/4a8546efd70700eed1e1f921e85293abf90d2691/include/cef_browser.h?at=master#cef_browser.h-364

Probably worth trying to search http://magpcss.org/ceforum/index.php
(Which is down at the moment, hopefully it'll be up again soon).

Is it specifically the zoom feature your after or just better high DPI support?

Please include what version your using and what flavour e.g WinForms or WPF
Reply all
Reply to author
Forward
0 new messages