I am making an application that searches the screen for a specific image. I read the picture (file) I am scanning for and convert it to a buffered image, then to an int[]
so I can process it faster. I also use the robot class to take a screenshot and convert to an int[]
.
While running code in Eclipse and having the files in the source folder, I don't have any problems. But after exporting my code to a runnable jar
file, my scanning methods no longer work. I think it might have something to do with compression because my pictures need to be exactly how they were taken.
The only success I have had with a "finished format" is by exporting the jar
normally, and using a folder in the same directory called images
to hold the files. Using this code:
File img = new File(System.getProperty("user.dir") + File.separator + "images" + File.separator + "Close.bmp");
When running directly from eclipse I can simply do this:
File img = new File(src/Close.bmp);
Any suggestions? Maybe some tips/settings on exporting jars?