Screenshot function / Windows Resolution Scaling
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:/
https:/
https:/
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.
Changed in sikuli: | |
status: | New → In Progress |
importance: | Undecided → Wishlist |
assignee: | nobody → RaiMan (raimund-hocke) |
milestone: | none → 2.0.6 |
I have determined you can get the adjustment value by running a shell command of:
wmic DESKTOPMONITOR get PixelsPerXLogic alInch
or
wmic DESKTOPMONITOR get PixelsPerYLogic alInch
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%