QB64 Phoenix Edition
Possible desktop reporting problem - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: Chatting and Socializing (https://qb64phoenix.com/forum/forumdisplay.php?fid=11)
+--- Forum: General Discussion (https://qb64phoenix.com/forum/forumdisplay.php?fid=2)
+--- Thread: Possible desktop reporting problem (/showthread.php?tid=1878)



Possible desktop reporting problem - doppler - 08-04-2023

Using _DesktopWidth and _DesktopHeight the reporting back numbers are off.  My display is 3840x2160.  But the reported numbers are 2560x1440.

Possible bug ?
Thanks to SMcNeill  helping with the proper commands.  See prior message....


RE: Possible desktop reporting problem - DSMan195276 - 08-04-2023

(08-04-2023, 09:40 PM)doppler Wrote: Using _DesktopWidth and _DesktopHeight the reporting back numbers are off.  My display is 3840x2160.  But the reported numbers are 2560x1440.

Possible bug ?
You likely have 150% scale selected in your display properties. Windows is scaling the QB64 program according to that setting, and thus reports to the program that the screen is smaller in dimensions than it actually is so that it appears correct to the program.

It's not entirely wrong, just confusing. If you do `SCREEN _NEWIMAGE(2560, 1440, 32)` in your program, you'll find it actually takes up the entire dimensions of your display even though it's smaller. Windows will scale the program by 150%, turning your 2560x1440 program into the 3840x2160 you're expecting.

We've had lots of discussions about this behavior this but it's not currently possible to disable the scaling by Windows. In the future you'll likely be able to decide how to handle it and optionally turn it off.


RE: Possible desktop reporting problem - doppler - 08-04-2023

(08-04-2023, 09:56 PM)DSMan195276 Wrote:
(08-04-2023, 09:40 PM)doppler Wrote: Using _DesktopWidth and _DesktopHeight the reporting back numbers are off.  My display is 3840x2160.  But the reported numbers are 2560x1440.

Possible bug ?
You likely have 150% scale selected in your display properties. Windows is scaling the QB64 program according to that setting, and thus reports to the program that the screen is smaller in dimensions than it actually is so that it appears correct to the program.

It's not entirely wrong, just confusing. If you do `SCREEN _NEWIMAGE(2560, 1440, 32)` in your program, you'll find it actually takes up the entire dimensions of your display even though it's smaller. Windows will scale the program by 150%, turning your 2560x1440 program into the 3840x2160 you're expecting.

We've had lots of discussions about this behavior this but it's not currently possible to disable the scaling by Windows. In the future you'll likely be able to decide how to handle it and optionally turn it off.
Hit that one on the head.  I do have scaling at that factor.  Only because everything gets too damn small, it's almost impossible to read.  I tried out windowspy from Autohotkey.  Very nice little program to show on screen info. (location, window, window dimensions.)  The X,Y mouse position shows the real desktop 3840x2160, not the scaled numbers.

Thanks for the heads up.


RE: Possible desktop reporting problem - SpriggsySpriggs - 08-07-2023

There's a way to grab the scaling in Win32 API, which you could then use to calculate the real screen size.