Screenshot function / Windows Resolution Scaling

Bug #1927536 reported by Jeremy Bost
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SikuliX
In Progress
Wishlist
RaiMan

Bug Description

I've seen a bunch of incorrect isolation concerning this issue. I've seen posts where the screenshot function shows a different resolution than expected. I've seen posts where people note they're using a 4k display, which also isn't a factor to this issue and some that report it without a clue as to any of the causes.

Basically, the issue is that the screenshot function uses a straight value for resolution in the Sikuli IDE. Windows has a scaling function that actually adjusts the displayed resolution based upon the scaling value selected. This means that the screenshot function's resolution value is always going to display the wrong area for the display when scaling is involved.

Here are some screenshots of how the screenshot function functions at different scaling:

https://ibb.co/drQLGhr - 125%
https://ibb.co/xshHg2C - 150%
https://ibb.co/7C06Ny4 - 175%

I guess my question is, would someone change the way the screenshot function gets it's value for resolution? Like, have it get the resolution value and the scaling value and calculate a final value for it to use?

This issue can be reproduced on any PC with Windows. You simply change your display resolution scaling and trigger the screenshot function. If it's difficult to find the location of where this setting is in windows, you can hit Win+R and type in: control desk.cpl and hit enter to bring up the right location or right click on the wallpaper area and pick display settings.

Revision history for this message
Jeremy Bost (sleepliving) wrote :

I have determined you can get the adjustment value by running a shell command of:

wmic DESKTOPMONITOR get PixelsPerXLogicalInch

or

wmic DESKTOPMONITOR get PixelsPerYLogicalInch

The X & Y should be identical for general scaling.

The number indicated tells what scaling value is being used.

96 - 100%
120 - 125%
144 - 150%
192 - 200%
240 - 250%
288 - 300%
384 - 400%
480 - 500%

RaiMan (raimund-hocke)
Changed in sikuli:
status: New → In Progress
importance: Undecided → Wishlist
assignee: nobody → RaiMan (raimund-hocke)
milestone: none → 2.0.6
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.