/** * create a ScreenImage with the physical bounds of this screen * * @return the image */ @Override public ScreenImage capture() { return capture(getRect()); }
Match element = region.find("loggedInIndicator.png") Screen screen = element.getScreen() String imagePath = screen.capture(element)
/** * create a ScreenImage with given region on this screen * * @param reg The Region to be captured * @return the image of the region */ @Override public ScreenImage capture(Region reg) { return capture(reg.getRect()); }
public String saveCapture(String name, Region reg) { ScreenImage simg; if (reg == null) { simg = userCapture("Capture for image " + name); } else { simg = capture(reg); } if (simg == null) { return null; } else { return simg.saveInBundle(name); } }
@Override public ScreenImage capture(Rectangle rect) { Debug.log(4, "ScreenUnion: capture: (%d,%d) %dx%d", rect.x, rect.y, rect.width, rect.height); Screen s = Screen.getPrimaryScreen(); // Location tl = new Location(rect.getLocation()); // for (Screen sx : Screen.screens) { // if (sx.contains(tl)) { // s = sx; // break; // } // } ScreenImage si = s.capture(rect); return si; }
return userCapture((String) arg0); } else if (arg0 instanceof Region) { return capture((Region) arg0); } else if (arg0 instanceof Rectangle) { return capture((Rectangle) arg0); ScreenImage shot = null; if (arg0 instanceof Region) { shot = capture((Region) arg0); } else { shot = userCapture((String) arg0); return capture((int) args[0], (int) args[1], (int) args[2], (int) args[3]);
/** * create a ScreenImage with given coordinates on this screen. * * @param x x-coordinate of the region to be captured * @param y y-coordinate of the region to be captured * @param w width of the region to be captured * @param h height of the region to be captured * @return the image of the region */ @Override public ScreenImage capture(int x, int y, int w, int h) { Rectangle rect = newRegion(new Location(x, y), w, h).getRect(); return capture(rect); }
if (observedRegion.contains(r)) { lastSearchTime = (new Date()).getTime(); Finder f = new Finder(new Screen().capture(r), r); f.find(new Pattern(img).similar(Settings.CheckLastSeenSimilar)); if (f.hasNext()) {