We are building a graffiti machine as a project on our school, the idea is to load an image and draw the pixels on canvas.
I have a problem with my code, i want to draw rectangles (to indicated the pixels) in a certain pattern (from top to bottom and then from the left to the right the collums).
But the image is only refreshed when the code is executed, I want to refresh the image every time a rectangle is drawn. I am very new with processing, so can someone maybe help me with this?
The code so far:
final int maxwidth = 2000; //maxwidth of drawingcanvas in mm
final int dotsize = 30; //diameter of spray in mm
final int nPixelRow = maxwidth/dotsize; //number of pixels per row
final int imagewidth = 300;
int widthsquare = imagewidth/nPixelRow;
int [][] pixel2d = new int[imagewidth][imagewidth];
int [][] newpixel2d = new int [imagewidth][imagewidth];
int [] newpixel = new int[(imagewidth/widthsquare)*(imagewidth/widthsquare)];