Last active
December 27, 2017 08:00
-
-
Save KrabCode/1e80051f3faf5bab18eafc71cbbab6b7 to your computer and use it in GitHub Desktop.
Recursive screenshot display resulting in a feedback loop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.*; | |
PImage orig; | |
public void settings() { | |
int scl = 85; //percent of the screen size (comment this and uncomment fullscreen for 100) | |
size(round((1920/100)*scl), round((1080/100)*scl)); | |
// fullScreen(); | |
orig = screenshot(); | |
} | |
public void draw() { | |
orig = screenshot(); | |
image(orig, 0,0,width, height); | |
} | |
public void setup() { | |
} | |
private PImage screenshot() { | |
PImage screenshot = null; | |
try { | |
screenshot = new PImage(new Robot().createScreenCapture( | |
new Rectangle(0, 0, displayWidth, displayHeight))); | |
} catch (AWTException e) { | |
e.printStackTrace(); | |
} | |
return screenshot; | |
} |
Author
KrabCode
commented
Dec 1, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment