How to pass images stored in a db in click/find functions using java code

Asked by Nick Moutsios

Hello!

I have all my images stored in a db and i am trying to find a way to use them with sikuli's functions.
Lets say i want to use click. You can pass a PSMRL object as a parameter which can be a String, match, region, location or a pattern.
It seems that the only thing i could use is the Pattern object which can have a BufferedImage passed in its constructor. I have the latest sikuli jar and i cannot use the pattern object that way... I cannot pass a BufferedImage in its constructor...

I really don't want to have the images stored in a folder...
Is there any other way i can solve this?

Any help would be really appreciated!
Thanks!

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

would be helpful, to see the relevant code snippet and the errors you get.

Revision history for this message
Nick Moutsios (nickmoutsios) said :
#2

Thanks for the reply RaiMan, so what i am trying to do is this:

BufferedImage bImg = dbImg.toBufferedImage();
Pattern target = new Pattern(bImg);
screen.click(target);

I am getting "The constructor Pattern(BufferedImage) is undefined"
Although the documentation and the source code says otherwise...

Is there any other way i can pass the image as the target?

Revision history for this message
RaiMan (raimund-hocke) said :
#3

No idea about that problem - you seem to be right.
You seem to have far more knowledge than I about Java.

You might patch the Pattern class to your needs and replace it in the sikuli-script.jar or use some dynamic java stuff.

You might propose your patch to the developers.

Can you help with this problem?

Provide an answer of your own, or ask Nick Moutsios for more information if necessary.

To post a message you must log in.