We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hello all. I want to save a frame to a folder different than the sketch folder. I have looked online how to do this but I have found no clear answers. If the code is necessary, I will post it, but i feel as though it is too long to merit posting right now. Thanks for your help.
Answers
if you want it to be a sub-folder of the sketch folder then
if you want to same it somewhere completely different use the full path name:
(linux paths used in examples)
I tried doing what you said, and it turn it only saves one image, and creates a new group of folders in my sketch folder, with the file inside another folder labeled documents inside one labeled name inside one labeled Users. The image never changes and no new files are ever added.
https://forum.processing.org/two/discussion/14595/simple-file-operations/p1
https://processing.org/reference/save_.html
Give it a try using the info in the first link. The second link is a reference. Post all your code as well as it will help to tackle your issue.
Kf
Line 3 is relative pathname, you need an absolute one, so add a drive letter if you're using windows, a leading / on other systems.
SaveFrame uses # symbols in the filename and replaces them with numbers. We can't see what you are using in the snippet you posted.
Here is all the code. The save in question is at 347 (Right before the Ball class and at the end of the checkMove() function.
You are calling save with the same name every time. It is obviously going to overwrite itself.
You are calling save frame using a single letter, relative filename, which does increment but doesn't have an extension. Maybe it doesn't know what file format to use (I think it defaults to TIFF). These files will be in your sketch folder.
ArrayLists have a clear () method that deletes all the entries.
I've also mentioned many times about clear() in 1 of his old posts: :-@
https://forum.Processing.org/two/discussion/17806/remove-clear-objects-from-an-arraylist#Item_3
Haha, yeah. I meant to change that but I guess I forgot; anyways, it doesn't really matter anymore. If it isn't broken...Anyways, is there any way I can change it so that it doesn't overwrite the existing files? And the program still does not save to the desired folder at all.
This should work based on the documentation:
You have to make sure the entire folder path exist and that you have permission to write there.Otherwise you have to create the folders before saving the files.
I would suggest creating a small sample code to ensure it works as you want it before using it in your main code. It will make things a bit easier to debug.
Kf
That works like a charm. Thanks for all the help!