We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › sequential screenshots
Page Index Toggle Pages: 1
sequential screenshots (Read 496 times)
sequential screenshots
Sep 13th, 2007, 6:38pm
 
hi

how would i modify this code to output a new screenshot with each screen update but with a different name each time like screen1.bmp, screen2.bmp etc...

thanks in advance

mike

...


void setup() {
frameRate(4);
smooth();
 size(255, 255);
//noLoop(); //outputs a static image - comment out to make motion
background(0, 0, 0);
}

void draw() {

float[] value = new float[5];
value[0] = 0;
value[1] = 255;
value[2] = 128;
value[3] = 170;//get real value
value[4] = 80;//get real value
int i = floor(random(0,4));
int j = floor(random(0,4));
int k = floor(random(0,4));

noStroke();
rect(0, 0, 85, 255);
fill(value[k], value[i], value[j]);
rect(85, 0, 170, 255);
fill(value[k], value[j], value[i]);

//saveFrame("out4.bmp");//uncomment to output a screenshot
delay(1000);//1 second delay before looping back to the beginning
}


Re: sequential screenshots
Reply #1 - Sep 13th, 2007, 7:32pm
 
use the second example from the reference:
http://processing.org/reference/saveFrame_.html
Page Index Toggle Pages: 1