← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #203485]: How to get the realtive or the exact cordinate for a region

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
based on this page:

# the static ref image is the logo top left with minimum background

ref = find(sikuli_logo)
menuOverview = ref.right(20).right(65).above(1).below(35).below(22)
menuOverview.highlight(2)

to measure the distances see faq 1686 or use the IDE's preview.

If you might wonder:

step1 gives you x and width
ref.right(20).right(65)

step2 gives you y and height
.above(1).below(35).below(22)

tricky, but it is a one liner ;-) all other approaches need more lines
of code.

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