2022-08-15 00:24:18 -05:00
|
|
|
package sig;
|
|
|
|
|
2022-08-15 00:30:52 -05:00
|
|
|
import java.awt.AWTException;
|
|
|
|
import java.awt.Robot;
|
|
|
|
import java.io.File;
|
|
|
|
import java.io.IOException;
|
|
|
|
|
|
|
|
import javax.imageio.ImageIO;
|
|
|
|
|
|
|
|
import java.awt.Rectangle;
|
2022-08-15 00:24:18 -05:00
|
|
|
|
|
|
|
public class JavaProjectTemplate {
|
|
|
|
public static void main(String[] args) {
|
2022-08-15 00:30:52 -05:00
|
|
|
try {
|
|
|
|
Robot r = new Robot();
|
|
|
|
|
|
|
|
System.out.println("Waiting 5 seconds before starting...");
|
|
|
|
|
|
|
|
final Rectangle capture = new Rectangle(312,118,1352,889);
|
|
|
|
|
|
|
|
Thread.sleep(5000);
|
|
|
|
|
|
|
|
//312,118 1352,889
|
|
|
|
ImageIO.write(r.createScreenCapture(capture),"png",new File("test.png"));
|
|
|
|
} catch (AWTException | IOException | InterruptedException e) {
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
2022-08-15 00:24:18 -05:00
|
|
|
}
|
|
|
|
}
|