3 ms·
Your understanding how DPI scaling works on Windows is completely wrong. > As far as I know there is no magical 'hey, I'm DPI aware' flag in Windows Yes, ther
by zokier 13y ago
Your understanding how DPI scaling works on Windows is completely wrong.
> As far as I know there is no magical 'hey, I'm DPI aware' flag in Windows
Yes, there is exactly that kind of flag. Your application either sets the flag in its manifest, or calls `SetProcessDpiAwareness` function.
> In Windows (I'm talking about the old native-code API here - no idea about Windows.Forms or WPF), when you say "draw me a 1px wide line here", you get a 1px physical line drawn.
No. The default (ie if you are not claiming to be DPI aware) is that your draws end up on a 96DPI "virtualized" surface, which is then scaled up by the compositor (DWM) to the real DPI. Effectively that means that your 1px line becomes 2px line. You can only draw real 1px lines on hidpi screens if you claim to be DPI aware.
This article documents the behavior quite extensively: http://msdn.microsoft.com/en-us/library/windows/desktop/dn469266%28v=vs.85%29.aspx http://msdn.microsoft.com/en-us/library/windows/desktop/dn46...