← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #144835]: how to create a region instance??

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
Principally you did the right thing -- but uuuups

there the docs might irritate at first glance, since in fact
selectRegion() is a Screen method (it is mentioned, but ...)

so the usage is generally Screen(x).selectRegion() or just
selectRegion() if you want to select on primary screen (SCREEN).

I will revise the docs.

One more thing:
With Sikuli X-1.0rc1, selectRegion() does not work on windows, so you have to use (only for one or two days until RC2 is out ;-) a manually defined Region using Region(x,y,w,h) or derive it from another one you already have, e.g.
m = find(some_image)
newReg = m.left(1).below().right()

this would give you a region below and right of the match's lower left
corner extending to the button and right side of the screen.

have a look at the docs for even more options.

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