Great !
this is it
Thanks SELTAR
But now I have another problem.
I'm trying to create a simple user interface with controlP5 library.
It's easy to put the button on the first window.
But how to chanche the image placed on second window by clicking that button on the first screen ?
I've written function which do negative of an image.
When I'm calling this function by pressing button on the first screen, the image on the second window doesn't change (still the same source loaded image).
void negative() {
a=img;
loadPixels();
for (int i = 0; i < pixels.length; i++ ) {
float r = red (a.pixels[i]);
float g = green (a.pixels[i]);
float b = blue (a.pixels[i]);
r = 255 - r;
g = 255 - g;
b = 255 - b;
color c = color(r,g,b);
pixels[i] = c;
}
updatePixels();
imageviewer.image(a,0,0);
imageviewer.redraw();
}
Function NEGATIVE show image (a) on second window but it is not modyfied. WHY the source image is displaying ?
how to modify this image ?
PLEASE HELP if you understan me :]
sory for my English. it is not perfect.