← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #250646]: JAVA: Multiple images in a short time.

 

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

Jeremy posted a new comment:
Thanks for the info. I'll put in the 0. That is helpful and much
appreciated. I have used that in the past. I just forget sometimes. :)

I do have a smaller region. I have that programmed already. I use this when creating a region. I have a  great program to get the screen size. It took me a while to figure that one out.
{
        Screen s = new Screen();
        s.setROI(screensize);
}

As far as the image, I used to have a large java file. It had a PICTURE = 3. Then a switch(number) if three return "picture.png" It got to be very large and cumbersome. I have over 160 pictures and a lot of lines of code. I found it best to do something like this:
public enum ImgData {
	Android_Home ("Android_Home.png"),
	Android_Menu ("Android_Menu.png"),
	Android_Menu_Manage_Apps ("Android_Menu_Manage_Apps.png"),
.....

	private final String filename;
	
	private static String getLocation(){
		return "..\\..\\Images\\";
		
		//return "C:\\programs\\DropBox\\Programs\\Images\\";
	}

	public String toString(){
		return getLocation() + filename;
	}


I did edit my code before I posted it. It would be closer to ImgData.Result_Defeat.toString(). I use ..\\..\\ so I can use it on multiple computers.

I'll keep an eye out for the new stuff. You have a really good program.
It is fun to program.

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