How to get location of image if exists

Asked by julien abou fadel on 2020-08-25

I have an image and i want to first check if it exists then get its location in order to do something based on that picture location.
Any suggestions?

Question information

Language:
English Edit question
Status:
Answered
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Last query:
2020-08-25
Last reply:
2020-08-26

This question was reopened

RaiMan (raimund-hocke) said : #1

See docs.

julien abou fadel (jga123) said : #2

getRegion() method? correct?

julien abou fadel (jga123) said : #3

correct if wrong

masuo (masuo-ohara) said : #4

@julien abou fadel
https://sikulix-2014.readthedocs.io/en/latest/region.html#Region.exists
https://sikulix-2014.readthedocs.io/en/latest/match.html#Match

[example codes:]
m = exists("1598404408149.png",0)
print m
if m:
    print m.getX()
    print m.getY()
    print m.getCenter()
    mouseMove(m.getCenter())

Can you help with this problem?

Provide an answer of your own, or ask julien abou fadel for more information if necessary.

To post a message you must log in.