We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have been looking all over, but can't seem to find out how to do it.
I know you the saveFrame() function works with "filname-###.jpg"
Code:
import processing.pdf.*;
int total = 40;
PShape mask;
void setup() {
size(500, 500, PDF, "NIR-###.pdf");
background(255);
strokeWeight(200);
smooth();
mask = loadShape("white-mask.svg");
}
void draw() {
for (int i = 0; i < total; i++) {
float q = random(500);
float r = random(10,500);
float g = random(10,255);
stroke(random(250,255),random(0,255),90,255);
line(q, 0, r, height);
}
shape(mask,0,0,500,500);
if (frameCount == 100);
println("D O N E");
exit();
}
void mousePressed() {
background(255);
redraw();
}
void keyPressed() {
if(key == 's')
{
saveFrame("NIR-###.jpg");
}
if(key == 'a') {
setup();
redraw();
}
}
Answers
How'bout
Thanks!