How to get the realtive or the exact cordinate for a region

Asked by vidya rajagopal

Hi

I want to know how to get the realtive or the exact cordinate for a region.
Basicaly i have a image where i have one static icon and rest all dynamic text. I need to get the dynamic text and decide my action . Please let me know how do i get the region of this text from the static icon using left . right , below, etc method

thanks

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
Best RaiMan (raimund-hocke) said :
#1

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.

Revision history for this message
vidya rajagopal (vidya-rajagopal) said :
#2

Thanks

Revision history for this message
vidya rajagopal (vidya-rajagopal) said :
#3

Thanks RaiMan, that solved my question.