You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/DpiAware.md
+25-5Lines changed: 25 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ Table of contents:
16
16
*[GetSystemDpi](#getsystemdpi)
17
17
*[IsProcessDpiAware](#isprocessdpiaware)
18
18
*[SetProcessDpiAware](#setprocessdpiaware)
19
+
*[Scale](#scale)
19
20
20
21
21
22
@@ -37,13 +38,13 @@ Enabling High DPI support in app can be done by embedding a DPI awareness xml ma
37
38
| height | int |
38
39
|__Return__| tuple |
39
40
41
+
Deprecated. Use `Scale()` method instead which can handle
42
+
non standard DPI settings such as '132%' on Windows 10.
43
+
40
44
This utility function will adjust width/height using
41
45
OS DPI settings. For 800/600 with Win7 DPI settings
42
46
being set to "Larger 150%" will return 1200/900.
43
47
44
-
Calculation for DPI < 96 is not yet supported. Use
45
-
the `GetSystemDpi` method for that.
46
-
47
48
48
49
### EnableHighDpiSupport
49
50
@@ -68,20 +69,29 @@ Description from upstream CEF:
68
69
69
70
Returns tuple(int dpix, int dpiy).
70
71
72
+
Returns Windows DPI settings ("Custom scaling" on Win10).
73
+
71
74
Win7 DPI (Control Panel > Appearance and Personalization > Display):
72
75
73
76
* text size Larger 150% => dpix/dpiy 144
74
77
* text size Medium 125% => dpix/dpiy 120
75
78
* text size Smaller 100% => dpix/dpiy 96
76
79
77
-
Example zoom levels based on DPI. For use with the ApplicationSettings.`auto_zooming` option.
80
+
Example zoom levels based on DPI. For use with the
81
+
ApplicationSettings.`auto_zooming` option.
78
82
79
83
* dpix=96 zoomlevel=0.0
80
84
* dpix=120 zoomlevel=1.0
81
85
* dpix=144 zoomlevel=2.0
82
86
* dpix=72 zoomlevel=-1.0
83
87
84
-
If DPI awareness wasn't yet enabled, then `GetSystemDpi` will always return a default 96 DPI.
88
+
If DPI awareness wasn't yet enabled, then `GetSystemDpi` will always
89
+
return a default 96 DPI.
90
+
91
+
DPI settings should not be cached. When `SetProcessDpiAware`
92
+
is not yet called, then OS returns 96 DPI, even though it
93
+
is set to 144 DPI. After DPI Awareness is enabled for the
94
+
running process it will return the correct 144 DPI.
85
95
86
96
87
97
### IsProcessDpiAware
@@ -106,3 +116,13 @@ See [Issue #358](../../../issues/358) for how the behavior changed in
106
116
latest CEF. This method now internally calls `EnableHighDpiSupport()`.
107
117
108
118
Enables DPI awareness for the running process. Embedding a DPI manifest in .exe is the prefered way, as it gives more reliable results, otherwise some display bugs may appear (discussed in the "Introduction" section on this page).
0 commit comments