← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #293503]: Region(x, y, w, h) - what are w and h?

 

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

    Status: Open => Answered

Manfred Hampl proposed the following answer:
Remark, in the example below
http://doc.sikuli.org/region.html#creatingaregionsettingandgettingattributes
there is code using the width value for height assignment. This might be
also misleading.

theWidth = reg.getW()
...
reg.setH(theWidth)

This sets the height of the region equal to the width, i.e. a square
region.

I.m.h.o. a better example would be something like

theWidth = reg.getW()
..
theHeight= theWidth / 2
...
reg.setH(theHeigth)

to avoid using the width value in a height assignment.

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