Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.AWTException;
- import java.awt.Rectangle;
- import java.awt.Robot;
- import java.awt.Toolkit;
- import java.awt.image.BufferedImage;
- import java.io.File;
- import java.io.IOException;
- import java.util.Scanner;
- import javax.imageio.ImageIO;
- /**
- *
- * @author eoin
- */
- public class JavaApplication4 {
- private static int a;
- /**
- * @param args the command line arguments
- * @throws java.awt.AWTException
- * @throws java.io.IOException
- */
- public static void main(String[] args) throws AWTException, IOException, InterruptedException {
- System.out.println(" {__ {__ {__ {__ {___ {__ {__ ");
- System.out.println("{_ {__ {__ {__ {__ {__ {__ {_ {__");
- System.out.println("{_ {__ {__ {__{__ {__ {__ {_ {__");
- System.out.println(" {__{__ {__ {__{__ {__ {__ {_ {__");
- System.out.println(" {__ {__{__ {__ {___{___ {_ {__");
- System.out.println(" {___ ");
- System.out.println("GNU general public");
- //System.out.println("Start screen recording?: Y/N");
- //Scanner scan = new Scanner(System.in);
- //int framerate = scan.nextInt();
- //framerate = a;
- // TODO code application logic here
- while(true) {
- Thread.sleep(1000L)
- // do something
- // pause to avoid churning
- /*
- * Hammer the JVM with junk
- */
- a++;
- System.out.println("FRAME" + a);
- /* File location is C:\Users\computerName\screenshot.png */
- File saveImage = new File(System.getProperty("user.home") + "/Desktop" + a +"\\screencast.png");
- /* Define how much area you want to capture */
- Rectangle rectangle = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
- /* Capture image */
- BufferedImage imageCapture = new Robot().createScreenCapture(rectangle);
- /* Write BufferedImage to file */
- ImageIO.write(imageCapture, "png", saveImage);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement