get pixel colour from offscreen buffer
in
Programming Questions
•
2 years ago
Hello everyone,
Im very new to processing and programming anything apart from BASIC and non linear languages like max/pd but am ready to make the leap.
I was wondering could anyone give me any pointers on how to get pixel colour data from an image loaded into an offscreen buffer so that it does not display. I though maybe i could also load an image to loadPixels without it displaying but have not found out how to do that yet either.
here is my messy first patch that probably contains a whole world of bad programming habits, any pointers would be great.
thanks for your time :)
PGraphics buffer;
PImage img;
PImage b;
void setup() {
size(800, 600);
buffer = createGraphics(800, 680, P3D);
b = loadImage("PROC01.gif");
image(b, 0, 0);
}
void draw() {
color cp = get(30, 20);
fill(cp);
rect(30, 20, 55, 55);
}
1