I have a WPF app that I want to look the same at all times on all DPI scaling settings on any monitor. By this I mean that the app should have the same size in real physical pixels as it has when scaling is set to 100%, at all times.
Currently, the app is scaled up when I start it if DPI scaling is set to anything larger than 100%. I don't want this.
If I give the window a width of 500 pixels, and I can't stress this enough, I expect it to be 500 real physical pixels wide on any and all monitors regardless of DPI scaling.
I tried everything I could find under the sun:
- Tried all possible combinations of dpiAware and dpiAwareness settings in the app manifest.
- Tried all values in the "High DPI scaling override" menu on the compatibility properties of my executable.
- Tried setting
DoNotScaleForDpiChanges
in the visual studio project file (*.csporj). - I read that any programmatic way to do this is futile since the code runs after the process / window is created and therefore scaling is already set, but for the sake of my mental health I still tried it... and failed.
Can this be done or should I just give up and switch over to linux?