C
C#2mo ago
Richard01_CZ

WPF, window doesn't open with specified resolution

I have a button in my WPF project that opens a different window. Window should be 640x480 but when it opens by pressing the button it has the resolution of 800x600. I tried to set the resolution in the window xaml and code behind before opening the window. Window only has an image which resolution is also set to 640x480.
No description
7 Replies
Richard01_CZ
Richard01_CZOP2mo ago
the xaml of the window that should be 640x480 but isn't i also noticed that when i set the window resolution to 100x100 in xaml, it becomes 125x125 when opened
ero
ero2mo ago
your desktop is likely set to 125% scale
Richard01_CZ
Richard01_CZOP2mo ago
yes it is....... well, can i somehow force it to always be a specified resolution regardless of desktop scale?
ero
ero2mo ago
possibly, but that's a bad idea
Richard01_CZ
Richard01_CZOP2mo ago
indeed it is
ero
ero2mo ago
your app would have different sizes on different scales, things could easily be misaligned
Richard01_CZ
Richard01_CZOP2mo ago
how come that the main window that is 500 wide is actually 500 wide? scale doesn't affect it it seems anyway, thank you for figuring it out for me
Want results from more Discord servers?
Add your server