← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #212945]: Get image target offset as x, y coordinates

 

Question #212945 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/212945

RaiMan proposed the following answer:
Sorry, a typo and  just checked:

p = Pattern(image).targetOffset(x,y)
print p.getTargetOffset() # this is the relative offset

m = find(p)
print m. getTarget() # this is the absolute point on the screen 

so if you want to calculate the offset from the match
c = m.getCenter()
t = m.getTarget()
off = Location(t.x - c.x, t.y - c.y)

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.