-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathImage.java
More file actions
31 lines (27 loc) · 877 Bytes
/
Image.java
File metadata and controls
31 lines (27 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.chess;
import java.awt.AWTException;
import java.awt.Dimension;
import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.File;
import org.junit.Test;
import org.openimaj.image.DisplayUtilities;
public class Image {
@Test
public void grapScreen() throws InterruptedException, AWTException {
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
screenSize.setSize(954, 681);
Rectangle screenRectangle = new Rectangle(screenSize);
Robot robot = new Robot();
BufferedImage image = robot.createScreenCapture(screenRectangle);
DisplayUtilities.display(image);
robot.delay(60000);
}
@Test
public void path(){
String path = System.getProperty("user.dir");
System.out.println(new File("chessEngine/BugCChess.exe").getPath());
}
}