5 unstable releases
Uses old Rust 2015
0.3.0 | Mar 18, 2018 |
---|---|
0.2.0 | Mar 18, 2018 |
0.1.4 | Aug 14, 2017 |
#686 in Operating systems
Used in dxgi
10KB
142 lines
windows_dpi
[dependencies]
windows_dpi = "0.1"
extern crate windows_dpi;
fn main() {
// Make sure the OS knows you're paying attention to DPI so it won't scale your window
windows_dpi::enable_dpi();
// Get the basic scaling factor so you can know how big to make your windows
let mut scaling_factor = windows_dpi::desktop_dpi();
let window = create_window(scaling_factor);
// Now that you have your window, check what its real scaling factor is
scaling_factor = unsafe { windows_dpi::get_dpi_for(window.platform_handle()) };
// Do some drawing stuff
draw_graphics(&window, scaling_factor);
}
Dependencies
~6–415KB