sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #06796
Re: [Question #178288]: How to get the screen zone (using Java) e.g top left zone, top right zone, ...etc
Question #178288 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/178288
youssef ben gave more information on the question:
Is this a right solution by using a rectangle:
final int SCREEN_HEIGHT = aScreen.getBounds().height;
final int SCREEN_WIDTH = aScreen.getBounds().width;
switch(lScreenZone)
{
case TOP_LEFT :
lRegion = aScreen.create(new Rectangle(0, 0, SCREEN_WIDTH/2, SCREEN_HEIGHT/2));
break;
case TOP_RIGHT :
lRegion = aScreen.create(new Rectangle(SCREEN_WIDTH/2, 0, SCREEN_WIDTH/2, SCREEN_HEIGHT/2));
break;
case BOTTOM_RIGHT :
lRegion = aScreen.create(new Rectangle(SCREEN_WIDTH/2, SCREEN_HEIGHT/2, SCREEN_WIDTH/2, SCREEN_HEIGHT/2));
break;
case BOTTOM_LEFT :
lRegion = aScreen.create(new Rectangle(0, SCREEN_HEIGHT/2, SCREEN_WIDTH/2, SCREEN_HEIGHT/2));
break;
case CENTER :
lRegion = aScreen.create(new Rectangle(SCREEN_WIDTH/4, SCREEN_HEIGHT/4, SCREEN_WIDTH/2, SCREEN_HEIGHT/2));
break;
}
The question is : did the x and y coordinates in the rectangle
definition refer to the upper left of the rectangle? otherwise , this
code is wrong;
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.