FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cefpython/cefpython/dpi_aware_win.pyx at cefpython31 · cztomczak/cefpython · GitHub
cztomczak
/
cefpython
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
477
Star
3.2k
Code
Issues
223
Pull requests
4
Actions
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
cefpython
/
cefpython
/
dpi_aware_win.pyx
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (33 loc) · 1.15 KB
Breadcrumbs
cefpython
/
cefpython
/
dpi_aware_win.pyx
Copy path
File metadata and controls
38 lines (33 loc) · 1.15 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#
Copyright (c) 2012-2014 The CEF Python authors. All rights reserved.
#
License: New BSD License.
#
Website: http://code.google.com/p/cefpython/
class
DpiAware
:
@
staticmethod
def
GetSystemDpi
():
#
Win7 DPI (Control Panel > Appearance and Personalization > Display):
#
text size Larger 150% => dpix/dpiy 144
#
text size Medium 125% => dpix/dpiy 120
#
text size Smaller 100% => dpix/dpiy 96
#
#
dpix=96 zoomlevel=0.0
#
dpix=120 zoomlevel=1.0
#
dpix=144 zoomlevel=2.0
#
dpix=72 zoomlevel=-1.0
#
#
If DPI awareness wasn't yet enabled, then GetSystemDpi
#
will always return a default 96 DPI.
cdef
int
dpix
=
0
cdef
int
dpiy
=
0
GetSystemDpi(
&
dpix,
&
dpiy)
return
(dpix, dpiy)
@
staticmethod
def
CalculateWindowSize
(int
width
, int
height
):
#
Calculation for DPI < 96 is not yet supported.
GetDpiAwareWindowSize(
&
width,
&
height)
return
(width, height)
@
staticmethod
def
IsProcessDpiAware
():
return
IsProcessDpiAware()
@
staticmethod
def
SetProcessDpiAware
():
SetProcessDpiAware()
Back
|
FazBrowse Home
|
New Git URL