We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi community.
Is it somehow possible to read the screen content under the processing window, to make stuff with it? The idea is to make a resizable window, which copies the normal stuff, so i can for example invert it.
Answers
Not easily, no. :)) =)) :>
well, strg-a, strg-c you can get it
but since you put it in with println you can just store it in an arraylist every time you use println
I lied. Here:
From:
http://vormplus.be/blog/article/taking-screenshots-with-processing
http://forum.processing.org/two/discussion/8025/take-a-screen-shot-of-the-screen
It's not documented at all but Processing's PImage class got an overloaded constructor which accepts an Image object:
https://github.com/processing/processing/blob/master/core/src/processing/core/PImage.java#L306
Therefore, we can directly pass Robot's createScreenCapture() as PImage's argument, since the former returns a BufferedImage:
new PImage( new Robot().createScreenCapture(new Rectangle(displayWidth, displayHeight)) );
No need for some extra getRGB() step at all! :D
Only use getRGB() when we already got an instantiated PImage w/ correct dimensions! :P