← 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

Manfred Hampl proposed the following answer:
see http://sikulix-2014.readthedocs.org/en/latest/region.html

A Region is a rectangular area on a Screen and is defined by
1.its upper left corner (x, y) being the pixel with this offset relative to the upper left corner of the screen (usually (0, 0) ) and
2.its dimension (w, h) as its width and height in pixels.

So if you have a screen with 1920*1080 and want to select a region in
the bottom center of 600*500 pixel size,

the x,y,w,h values should most probably be 660, 580, 600, 500

total width: 1920, center is 1920/2=960, and now half the rectangle size to the left gives 960-300=660
total height: 1080, the size of the rectangle up gives 1080-500=580
region width: 600
region height: 500

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