How to find x,y coordinates automatically when the system resulution may getting changed

Asked by manisha

Hello Sir,
     I'm facing resolution problem for one of my requirement. I have completed one test script and same i needs to execute in other system also in that case find failed error is coming. Here i got to know the error is coming because of resolution. In this type of situation how to overcome.
    For this kind of issue is there any method to identify automatically. Here I'm pasting my script and I had given x,y coordinates are manually.

     images = (Pattern("AtmosphericErro0r-2.png").targetOffset(62,-2))
     img = find(images)
     upperleft = Location(img.getX(), img.getY())

Please provide me the solution and Thanks in advance.. :)

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

resolution alone does not matter, as long as the image stays the same on the pixel level (it might then look smaller or larger).

It will no longer be recognised if width and/or hight in pixels change (stretching) or when the image in the different resolution is rendered differently (different pixel content).
If you get FindFailed with different resolution, then currently the only solution is to have different images for different resolutions.

Revision history for this message
Best RaiMan (raimund-hocke) said :
#2

You might as well analyse the differences with an image viewer in some magnification and maybe find out how to optimise the shot, so it fits in more than one resolution.

Revision history for this message
manisha (manishareddy1111) said :
#3

Thanks RaiMan, that solved my question.