Wednesday, September 18, 2013

Example code - Image Saving

int counter = 1; // at the top as a global variable

void setup(){
  size(500,500);
}

void draw(){
  ellipse(mouseX,mouseY,20,20);
}


void keyPressed(){   // outside of void setup and void draw
  if (key == 's') {
    save("capture_"+counter+".png");
    counter++;
  }
}

No comments:

Post a Comment