whe I use capture a Region, where is the image saved in my computer?

Asked by Erna Tercero

I set:

  //Getting the data
  @SuppressWarnings("deprecation")
  Region T = new Region(799,201,313,48);

  //String filePath;

  System.out.println(s.capture(T));

and the vaulue i get is: org.sikuli.script.ScreenImage@eac7c8

where is this file saved? or how can I name the file? how can i found the file?

Thanks in advance for your attention!!!

Question information

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

In the Java environment, the image is not saved to disk by Sikuli at once, it stays a BufferedImage in memory.
ScreenImage has a getImage(), that returns the contained BufferedImage.

As you can see in the java docs: http://sikuli.org/doc/java-x/

ScreenImage has a getFilename(), that only in this moment (lazy method, first time called) creates a file on disk and returns it.

Revision history for this message
Erna Tercero (erna-tercero) said :
#2

Thank you, i have now the File name, but this do not exist in disk, even when gives me the entire path:

C:\DOCUME~1\VENDOR~1\LOCALS~1\Temp\sikuli-scr-1833345246265736305.png

but no document exists, any other thing i am missing, here is the code:

@SuppressWarnings("deprecation")
  Region T = new Region(799,201,313,48);

  System.out.println(s.capture(T));

  ScreenImage i=s.capture(T);

  i.getImage();
  String filepath = i.getFilename();
  System.out.println(filepath);

Revision history for this message
Erna Tercero (erna-tercero) said :
#3

Thanks RaiMan, that solved my question.

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

Try to move the file to a safe place of your choice while program is running

Revision history for this message
Erna Tercero (erna-tercero) said :
#5

Thank you RainMan this was my implementation and really works!!!! now i am trying to implement a OCR to get the text in the image..

Sikuli rules!!