We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hello, i have been programming an image editor program, and i make an UI where you can click a button and change the image, but i have been struggling, i am trying to flip an image but it flips outside the range, i have been trying to use the scale(-1,1) but it havent work either or trying to set image(img, 600, 480) to put it at a zone that dont hides the menu bar, but it doest work either, please help.
here is the code i have been trying to use
int i = 0;
while (i < pixels.length) {
r = red (pixels[i]);
g = green(pixels[i]);
b = blue (pixels[i]);
color newColor = color(r, g, b);
pixels[pixels.length - 1 - i] = newColor;
i = i + 1; //next pixel!
if (i % width >= picWidth) // This will ignore anything on the line that goes after the image like buttons
i = i + width - picWidth;
Answers
https://forum.Processing.org/two/discussion/3439/how-to-do-flip-canvas-horizontal-to-an-image-and-save
im sorry, but i did what the discussion said and i got a "NullPointerException" :/
https://OpenProcessing.org/sketch/139280
https://forum.Processing.org/two/discussion/3439/how-to-do-flip-canvas-horizontal-to-an-image-and-save#Item_21