When finding an image on my 1080p side monitor with a 1440p main monitor, pyautogui.locateOnScreen('img.png') returns the correct point of Point(x=-1257, y=619), which moveMouseToLocation is able to use.
However, when running a similar piece of code
for position in pyautogui.locateAllOnScreen('img.png'):
print(pyautogui.center(position))
it returns Point(x=663, y=619).
I noticed that if I move the image to the bottom of my 1920x1080 screen, it returns locateAllOnScreen returns Point(x=652, y=1339), which doesn't even exist on the screen that it is on.
Is there a workaround for this, or is this a bug? Thank you.
That will sometimes happen I believe it depends on the screen resolution and a few other factors. The issue is usually that it doubles the actually sizes so try dividing the points by 2 and that should fix it.
When finding an image on my 1080p side monitor with a 1440p main monitor, pyautogui.locateOnScreen('img.png') returns the correct point of Point(x=-1257, y=619), which moveMouseToLocation is able to use.
However, when running a similar piece of code for position in pyautogui.locateAllOnScreen('img.png'): print(pyautogui.center(position))
it returns Point(x=663, y=619).
I noticed that if I move the image to the bottom of my 1920x1080 screen, it returns locateAllOnScreen returns Point(x=652, y=1339), which doesn't even exist on the screen that it is on.
Is there a workaround for this, or is this a bug? Thank you.