void setup() { size(1000,1000); fill(255); rect(0,0,1000,1000); } int gety=0; int getx=0; int feld=10; float mouseovery=0; float mouseoverx=0; int a=0; int b=0; int c=0; int save=0; int sumlx=0; int sumly=0; void draw(){ mouseovery = mouseY; mouseoverx = mouseX; noStroke(); a=(int)random(255); b=(int)random(255); c=(int)random(255); gety= (int)mouseovery; getx=(int)mouseoverx ; sumlx=floor(getx/feld); sumly=floor(gety/feld); if (mousePressed && (mouseButton == LEFT)) { fill(a,b,c); rect(sumlx*feld,sumly*feld,feld,feld); save=1; } if (mousePressed && (mouseButton == RIGHT)&&save==1) { save("bild.png"); save=0; save=0; } if( keyPressed == true){ PImage bild; bild = loadImage("bild.png"); if (bild != null) { image(bild, 0, 0); saveFrame("bild.png"); } }}