← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #670985]: Easy way to take screenshot and region at the same time

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
--- at first:

I understand, that you have captured an image (capturedImage) and now
want to have the exact region, this image occupies on the screen.

imageRegion = find(image)

now imageRegion is that region and you can say:

match = imageRegion.find(anotherImage)

which searches for anotherImage inside the region imageRegion.


--- at second:
if exists(image):
    click()

the click will immediately click what was found with exists() before (no
repeated search)

generally: someRegion.click() will click what was found with the latest find-op in that region someRegion.
when using just click(), the region is the whole screen (as with just exists())

BE AWARE: this all is true and working for SikuliX 1.1.2+ (using 1.1.3
nightly is recommended)

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.