Programing

Screen Capture Class(화면 캡쳐 클래스) Robot

W.A 2010. 7. 16. 10:17

public class Main {

public static void main(String[] args) throws AWTException, IOException {

Robot robot = new Robot();

// Rectangle 를 설정한 부분의 Capture

Rectangle selectRect = new Rectangle(500, 1000);

BufferedImage buffImg = robot.createScreenCapture(selectRect);

File imgFile = new File("image.jpg");

ImageIO.write(buffImg, "jpg", imgFile);

}

}