Skip to content

Instantly share code, notes, and snippets.

@KrabCode
Last active December 27, 2017 08:00
Show Gist options
  • Save KrabCode/1e80051f3faf5bab18eafc71cbbab6b7 to your computer and use it in GitHub Desktop.
Save KrabCode/1e80051f3faf5bab18eafc71cbbab6b7 to your computer and use it in GitHub Desktop.
Recursive screenshot display resulting in a feedback loop
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;
}
@KrabCode
Copy link
Author

KrabCode commented Dec 1, 2017

feedback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment