MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / dpi_scale

Function dpi_scale

native/windows/src/lib.rs:275–280  ·  view source on GitHub ↗

Current per-monitor DPI scale for this window (1.0 on a 96-DPI monitor, 2.0 on a Retina-class 192-DPI monitor, etc.). Falls back to 1.0 if the API is missing (pre-Win10 1607).

(hwnd: HWND)

Source from the content-addressed store, hash-verified

273 /// monitor, 2.0 on a Retina-class 192-DPI monitor, etc.). Falls
274 /// back to 1.0 if the API is missing (pre-Win10 1607).
275 pub fn dpi_scale(hwnd: HWND) -> f64 {
276 unsafe {
277 let dpi = GetDpiForWindow(hwnd);
278 if dpi == 0 { 1.0 } else { dpi as f64 / 96.0 }
279 }
280 }
281
282 pub fn poll_events() {
283 unsafe {

Callers 1

wndprocFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected