blank space in the window when calling the window screen api, after setting the windows 11 resolution scale to 125%

Just starting out? Need help? Post your questions and find answers here.
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 799
Joined: Fri Dec 04, 2015 9:26 pm

blank space in the window when calling the window screen api, after setting the windows 11 resolution scale to 125%

Post by skinkairewalker »

I noticed that if I set the Windows 11 resolution scale to 125%, there is a blank space after calling OpenWindowedScreen

If I set it back to 100%, apparently the problem is fixed.to solve, I decided to multiply the resolution *0.80 ( I don't know if this makes any mathematical sense or if it's just a coincidence of my monitor... )

is anyone else having the same problem?

screenshot : https://prnt.sc/lpJE0B-M5HcY
User avatar
jacdelad
Addict
Addict
Posts: 2031
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

Re: blank space in the window when calling the window screen api, after setting the windows 11 resolution scale to 125%

Post by jacdelad »

...and you didn't forget to enable the dpi aware setting? In other words: Does the same happen happen when you flip the dpi aware option?
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Fred
Administrator
Administrator
Posts: 18350
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: blank space in the window when calling the window screen api, after setting the windows 11 resolution scale to 125%

Post by Fred »

The OpenWindowedScreen() dimensions are in real pixels, so if you create a DPI aware executable, you need to adjust it with DesktopScaledX/Y(). When DPI flag is on, all the window/gadget x,y,width/height are in virtual pixels (always like 100% DPI).
User avatar
skinkairewalker
Enthusiast
Enthusiast
Posts: 799
Joined: Fri Dec 04, 2015 9:26 pm

Re: blank space in the window when calling the window screen api, after setting the windows 11 resolution scale to 125%

Post by skinkairewalker »

Awesome jacdelad and Fred !
Thank you for the knowledge, as the saying goes: 'live and learn.'
Post Reply