← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #665797]: Image reconition not working after Settings.OcrTextRead = true;

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
the problem is this:
screen.setRect(rectangle);

which means that on the screen it is searched only in the given
rectangle.

after the loop, you have to reset the screen object:
screen = new Screen()

to restore to the whole screen.

generally it is not recommended to use screen.setRect(), since this may
lead to such quirks if not reset and may be hard to debug.

--- better:
for(int i = 0; i < 4; i++) {
    Thread.sleep(3000);
    //Rectangle rectangle = new Rectangle(500, 550+(i*25), 75, 20);
    Region reg = new Region(500, 550+(i*25), 75, 20);
    //screen.setRect(rectangle);
    //String xx= screen.text();
    String xx= reg.text();
    xx= xx.substring(1);
    System.out.println("$"+xx);
   }

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