← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #252512]: How to use regions properly

 

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

    Status: Open => Answered

Eugene S proposed the following answer:
Hi,

You search should be for a region but for a pattern.
First you must create screenshots of patterns you wish to detect on the screen. Then, once you have the patterns and you have defined the region, you can search for these patterns within the region. For example:

region = Region( 40, 230, 75, 350)
region.find("pattern1.png")

A possible way to look for multiple patterns(images) in the same area:

imagesList = ["image1.png", "image2.png", "image3.png"]

for image in imageList:
     try:
          region.find(image)
          print "image %s found!" %(image)
     except:
          print "image %s NOT found!" %(image)


Cheers,
Eugene

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