I use CEF3 for displaying a web page in my Windows application. It works fine, but it doesn't scale if Windows has higher DPI settings (e.g. 150%). I don't expect it to do this automatically but I also don't find any property which can be set to tell chromium to scale. Is there any way to do that?

有帮助吗?

解决方案

Zoom and scale are different things as you already noticed. I think this is the formula you are looking for:

    public void SetScaleFactor(double scale)
    {
        double zoomLevel = Math.Log(scale, 1.2);
        this._browserHost.SetZoomLevel(zoomLevel);
    }

You can give it a try and see the difference with zoom.

Good luck!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top