← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #237353]: [1.0.1] SikuliX-API (sikuli-java.jar): problem after upgrading from 0.10.2

 

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

RaiMan proposed the following answer:
Good news - bad news ;-)

good: I understand what is happening ;-)

bad: you cannot use 1.0.1, you have to wait for 1.1 (betas will start
next week)

- 1.0.1 does not find your patterns
you are loading the images from Java resource files as BufferedImages and use a Pattern(BufferedImage).
This seem to have worked in 10.0, but apparently was cut with SikuliX, where you only could create a pattern with image files.
To use images from resource files and BufferedImages directly will be available in 1.1

- problem with WinUtil.dll on Windows 8
apparently WinUtil.dll cannot be loaded on your Windows 8 (as your setup log reports)
I will check and try to fix it later towards end of this year, since I have to first get me a Windows 8 installation.

This is the Java code I used to check and confirm:

package sikulix.run101;
import org.sikuli.basics.Debug;
import org.sikuli.script.*;
public class SikuliXRun101 {
  public static void main(String[] args) throws Exception {
    //Debug.setDebugLevel(3);
    Screen s = new Screen();
    ScreenImage img = s.userCapture();
    Pattern pBImg = new Pattern(img.getImage());
    Pattern pFile = new Pattern(img.getFile());
    Debug.user("pattern: %s", pBImg);
    try {
      Debug.user("Match: %s", s.find(pBImg));
    } catch (FindFailed ex) {
      Debug.error(ex.getMessage());
    }
    Debug.user("pattern: %s", pFile);
    try {
      Debug.user("Match: %s", s.find(pFile));
    } catch (FindFailed ex) {
      Debug.error(ex.getMessage());
    }
  }
}

output produced:
[user (16.10.13 13:00:19)] pattern: P(-- BufferedImage --) S: 0.7
[error] can not find P(-- BufferedImage --) S: 0.7 on the screen.
[user (16.10.13 13:00:22)] pattern: 
P(/var/folders/wk/pcty7jkx1r5bzc5dvs6n5x_40000gn/T/sikuli-3135788393117307295.png) S: 0.7
[user (16.10.13 13:00:23)] Match: M[71,40 100x33]@S(S(0)[0,0 1920x1200]) S:0,98 Target:121,56

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