processing - What is the filename of last saved frame using saveFrame() -
in processing, can save frame using saveframe('output-####.png')
. save frame, name output-0001.png
, , place in sketch folder. filename different because follows sequence, replacing #### next number in sequence.
however, saveframe returns void. wish returned string of filename, doesn't.
how can find out name of frame saved saveframe(...)
you can wrap function tell framecount @ point:
void draw() { println(saveframeandgetfilename("output-####.png")); } string saveframeandgetfilename(string filename) { saveframe(filename); string [] parts = filename.split("####"); //getting pedantic here... return parts[0] + framecount + parts[1]; }
or more simply:
void draw() { saveframe("output-####.png"); println("output-" + framecount + ".png"); }
edit: fixed give actual filename
Comments
Post a Comment