diff --git a/chatlog.png b/chatlog.png new file mode 100644 index 0000000..5cf21cc Binary files /dev/null and b/chatlog.png differ diff --git a/src/sig/JavaProjectTemplate.java b/src/sig/JavaProjectTemplate.java index 652b573..fcbafda 100644 --- a/src/sig/JavaProjectTemplate.java +++ b/src/sig/JavaProjectTemplate.java @@ -2,8 +2,12 @@ package sig; import java.awt.AWTException; import java.awt.Robot; +import java.awt.event.KeyEvent; import java.io.File; import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.awt.image.BufferedImage; import javax.imageio.ImageIO; @@ -21,8 +25,46 @@ public class JavaProjectTemplate { Thread.sleep(5000); //312,118 1352,889 - ImageIO.write(r.createScreenCapture(capture),"png",new File("test.png")); - } catch (AWTException | IOException | InterruptedException e) { + List imgs = new ArrayList(); + + boolean done=false; + + while (!done) { + BufferedImage res = r.createScreenCapture(capture); + if (imgs.size()>1) { + //Compare to make sure we haven't reached the end yet. + BufferedImage lastImg = imgs.get(imgs.size()-1); + int matches=0; + outer: + for (int x=0;x(lastImg.getWidth()*lastImg.getHeight())*0.90) { //90% match required. + done=true; + System.out.println("Completed! Now stitching together final image."); + break outer; + } + } + } + } + imgs.add(res); + r.waitForIdle(); + r.keyPress(KeyEvent.VK_PAGE_DOWN); + r.delay(50); + r.keyRelease(KeyEvent.VK_PAGE_DOWN); + r.delay(1000); + } + + BufferedImage finalImg = new BufferedImage(capture.width,capture.height*imgs.size(),BufferedImage.TYPE_INT_ARGB); + for (int i=0;i