← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #266455]: Region arguments seem to be mixed up?

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
A region is defined by

reg = Region(x, y, w, h)

where (x,y) is the top left corner and w is the width and h is the height
(hence printing a Region you get (x,y wxh) )

so the calculation could be:

s0 = Screen() # which is screen 0

partW = int(s0.w/2)
partH = int(s0.h/2)

reg = Region(partW-300, partH, 600, partH)

BTW: with version 1.1.0 there are some convenience shortcuts to create subregions.
http://sikulix-2014.readthedocs.org/en/latest/region.html#get-evenly-sized-parts-of-a-region-as-rows-columns-and-cells-based-on-a-raster

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