← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #235158]: How to action (edit. click) for matrix pictures (n column, m rows)

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
If this is a regular matrix, that has an even row height and an even
column width:

ref = find("some fixed visual element near pic11.png").targetOffset(x,y)
# targetOffset to be set with Preview to point to center of pic11

rowH = h # to be evaluated e.g. using Preview again
colW = w # to be evaluated e.g. using Preview again

pic11 = ref.getTarget() # center of first image

for col in range(100):
    for row in range(100):
        print "pic%d%d"%(row + 1, col +1)
        clickPoint = pic11.offset(col * colW, row * rowH)
        hover(clickPoint) # for test 
        # rightClick(clickPoint)    

BTW: the usual numbering would be
11 12 13 14 ..... 1100
21 22 23 24 ..... 2100
...
1001 1002 1003 1004 ... 100100

and to get distinguishable numbers in each cell:
001001 001002 ... 001100
..
001100 002100 ... 100100

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