Missing something with Windows Screen Scale

Hello, i am trying to improuve my little capture Screen App but i’m lost with HiDPI and Windows Screen Scale options (100%, 125%, 150%).

Here is my code but no way to match with 150% resolution :slight_smile:

“scalefactor_double” can be selectable with 1, 1.25 or 1.5 in option menu

'Init
CaptureW.Top = 0
CaptureW.Left = 0
CaptureW.Width = Screen(0).AvailableWidth x scalefactor_double
CaptureW.Height = Screen(0).AvailableHeight x scalefactor_double

'Méthode de Capture sous Windows
CaptureW.Backdrop = captureRectangleWin(0,0,CaptureW.Width,CaptureW.Height)

I must have my CaptureW windows to the good size in order to trace and capture my region with the mouse.

My prog visible here : GitHub - LwRed/Xojo-CaptureEcran: Xojo Capture Screen for MacOs and Windows // Xojo 2017+ requis

Thanks a lot for your help

Found a first solution for my CaptureW windows frame
Locked “myframe” canvas, thanks Tim Parnell, see this tip below in this forum.

Added :

#if TargetWindows then
call SetProcessDPIAware 'Ne fonctionne que sous Windows
#endif

With in a module this Method

#if TargetWindows then
Declare Function SetProcessDPIAware LIb “User32.dll” () as Boolean
Return SetProcessDPIAware
#endif

And Shared option Support Hi-DPI = False

Seems to work properly now but don’t very understand… :slight_smile:

You do not liked the WIndows built-in screen shot features ?

Which features Emile ? Snipping tool ?

Making Screen Shots using Ctrl-PrntScrn (and variations).

Why not simply rely on screen(0).width and screen(0).height ?

If I don’t introduce a scalefactor multiplier, myFrameCanvas don’t fill the entire screen.

Ah I didn’t notice that you were running on xojo 2018r1.1, does that have the Supports Hi-DPI option in Build Settings>Shared (I don’t have it installed to quickly check) ? If it does and you check that on and remove the declare does that fix the issue?

See here for more information on this https://docs.microsoft.com/en-us/windows/win32/hidpi/setting-the-default-dpi-awareness-for-a-process

Essentially the app doesn’t know that things should be scaled so it just grabs what it thinks is the correct size image.

I am going to test with a more little project.

Thanks to all for your help :wink: