Skip to content

Commit ef270f4

Browse files
committed
Add region screenshot taking
1 parent bece24a commit ef270f4

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

selenium-bravo-servlet/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group 'com.bravostudiodev'
2-
version '2.2'
2+
version '2.3'
33

44
apply plugin: 'maven'
55
apply plugin: 'maven-publish' // task publishToMavenLocal

selenium-bravo-servlet/src/main/java/com/bravostudiodev/selenium/SikuliScreen.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
/**
2424
* Created by IgorV on 3.11.2016.
2525
*/
26+
@SuppressWarnings("unused")
2627
public class SikuliScreen {
2728
private static final Logger LOGGER = Logger.getLogger(SikuliScreen.class.getName());
2829

@@ -89,13 +90,16 @@ public String takeBase64Screenshot() throws IOException {
8990
return imageToBase64(new DesktopScreenRegion().capture());
9091
}
9192

92-
@SuppressWarnings("unused")
93-
public String takeBase64Screenshot(java.awt.Rectangle rc) throws IOException {
93+
private String takeBase64Screenshot(java.awt.Rectangle rc) throws IOException {
9494
ScreenRegion region = getScreenRegion(rc);
9595
LOGGER.info("taking region screenshot");
9696
return imageToBase64(region.capture());
9797
}
9898

99+
public String takeBase64Screenshot(String rcB64) throws IOException {
100+
return takeBase64Screenshot((java.awt.Rectangle) objectParse(rcB64));
101+
}
102+
99103
public String getScreenRectangle() {
100104
return objectSerialize(new DesktopScreen(0).getBounds());
101105
}

0 commit comments

Comments
 (0)