← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #215490]: Find and click image, then switch tabs

 

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

Bernard St-Pierre posted a new comment:
I understand whats going on in up to the first part below, but then it
breaks down in my brain when looking for the smallest capture possible

# find the position
imgBase = "1354182180938.png"
top = find(imgBase)
#top.highlight(2)

# get the surfbar
sbHeight = 85
sb = top.below(3).below(sbHeight)
#area.highlight(2)

# get the area of the left symbol
left = Region(sb.x, sb.y, 65, sbHeight)
#left.highlight(2)

# setup the regions for the others
oWidth = (sb.w - left.w)/4
other = []
for i in range(4):
    x = left.x + left.w + i*oWidth - 4
    other.append(Region(x, left.y, oWidth+8, sbHeight))
for r in other:
    pass
# r.highlight(1)

Please elaborate the next section...

# capture the image to search
# we have to try to get the smallest capture possible
# since the probe and the target have different positions
# this can be set fixed, if it is always the same

Can't sikuli find an image instead of some bit of non relevant grey's? I
say non relevant because each surfbar will be different than the
previous and its obvious that it won't find the same grey's as it did in
surfbar3??

Ben

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