I don't find the saveFrame file (set its path)

I was looking for a way to save the image, so I found this sample code.
I run it,
but no file were saved on my hard drive.

What am I missing?

int x = 0;
void draw() {
background(204);
if (x < 100)
{
line(x, 0, x, 100);
x = x + 1;
}
else
{
noLoop();
}
// Saves each frame as line-000001.png, line-000002.png, etc.
saveFrame(“line-######.png”);
}

missing setup() ?

This works here:


int x = 0;

void setup() {
  size(660, 770);
}

void draw() {
  background(204);
  if (x < 100)
  {
    line(x, 0, x, 100);
    x = x + 1;
  } else
  {
    noLoop();
  }
  // Saves each frame as line-000001.png, line-000002.png, etc.
  saveFrame("line-######.png");
}

Thanks. Will try it.

Where would the files be saved?
Can I change it?

1 Like

in processing type CTRL-k to open the sketch folder

it’s in this folder


Quote

  • Alternatively, the files can be saved to any location on the computer by using an absolute path (something that starts with / on Unix and Linux, or a drive letter on Windows).

see saveFrame() \ Language (API) \ Processing 3+


Here is an example

Here is an example to use the Sketch Path and make a new sub-folder in it

  // Saves each frame as line-000001.png, line-000002.png, etc.
  saveFrame(sketchPath("")+"my/"+"line-######.png");

hey, and welcome to the forum!

Great to have you here!

regards, Chrisir :wink:

1 Like

I found them :slight_smile: thanks

now I’ll try to figure how I save them in processing folder in drive F

yeah something like

"f:\\..." in Windows

This works for D in Windows

  // Saves each frame as line-000001.png, line-000002.png, etc.
  saveFrame("D:\\"
    +"my/"
    +"line-######.png");
1 Like

I wrote "f:\process\… "
And it worked :slight_smile:
Thank you so much

Now I can really start playing with this cool tool

1 Like