← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #686827]: sikulix: Want co-ordinates of text in a image given

 

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

Bhuvaneshwaran I gave more information on the question:
	public static Point getPositionOfImage(String screenPath,String filePath) {
		Point position=new Point();
		Finder finder=new Finder(screenPath);
		finder.findAll(filePath);
		if(finder.hasNext()) {
			Match match=finder.next();
			position.x=match.getX();
			position.y=match.getY();
			return position;
		}
		return null;
	}


	public static Point getPositionOfText(String screenPath, String text) throws FindFailed {
		Point position =new Point();
		Finder finder=new Finder(screenPath);
		Region r=finder.getRegion();
		r.existsText(text);
//		Screen s=new Screen();
//		IScreen sc=new IScreen("");
		Settings.SwitchToText=true;
//		Match r=s.findText(text);
		finder.findText(text);
		if(finder.hasNext()) {
			Match match=finder.next();
			position.x=match.getX();
			position.y=match.getY();
			return position;
		}
		return null;
	}

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.