← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #706490]: Easy way to take a screenshot and region at the same time (2)

 

Question #706490 on SikuliX changed:
https://answers.launchpad.net/sikuli/+question/706490

Description changed to:
Hi,
this one was asked before (and answered) (https://answers.launchpad.net/sikuli/+question/670985)
but the answer didn't solve my problem:

In Sikulix IDE I can do:
1. take a screenshot without region information or
2. take a region but without a screenshot.

If I do one after another, they most likely aren't pixel perfect.

I would like to take a "screenshot+region" in 1 step, so I could use it
later as:

if region1.exists(image1,0):
    click(region1.getLastMatch())
elif region2.exists(image2,0):
    click(region2.getLastMatch())

The reason I want to do this is to speed up the find operations.
In my application the images I want to click are always at the same exact locations, so I thought if the image matches the region perfectly, the find operation should be fastest.

Each image has its own location.
There can be images with the same location.
There can be images which I don't want to click (ignore).

Is there an easy way to do this, or maybe a different approach?

(Edit:)
My current (long) approach is:
1. take a region
2. script1 for saving a screenshot of that region to a file
3. Insert image into script2
4. copy region from script1 to script2

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