import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import javax.imageio.ImageIO;
public class pro{
public static void main(String[] args) {
try {
Rectangle bounds = new Rectangle(0, 0, 500, 500);
Robot robot = new Robot();
BufferedImage image = robot.createScreenCapture(bounds);
ImageIO.write(image, "jpg", new File("test.jpg"));
} catch (AWTException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
最終更新:2011年09月21日 20:42