We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hello everyone I have stuck up in a problem. Basically i am editing or say, I will draw a scratch on an image using "line(pmouseX, pmouseY, mouseX, mouseY);" Now I want to those changes to be get reflected in that image(i.e Pixels of image should get updated) . Is it possible to do that? So thanks for any help
Answers
Do you mean you want to export an image to a file?
If so, PImage has a save() function. The API is your friend: https://www.processing.org/reference/PImage.html
No, I mean this. suppose, I have drawn a line on an image. But its corresponding pixels would not get updated right? I mean if I save that image, that line would not come on output image. ( I am using line() function to draw line on the image)
How are you drawing the line?
Again, the API for PImage lists methods that allow you to change the pixels of the image.
Or you might be better off using PGraphics instead. The API is still your friend: http://processing.org/reference/javadoc/core/processing/core/PGraphics.html