Save image to a user-selected directory outside of the sketch-folder
in
Programming Questions
•
1 year ago
I created a paint program where users can draw images with a variety of tools. I am trying add the ability to save the user drawn image to a "My Drawings" folder that is created on the desktop. So far I have this...
- if(keyPressed) {
- if(key == ' ') {
- PImage drawingArea = get(40, 20, 720, 780);
- drawingArea.save("My Drawings/" + "My Drawing" + drawingNum + ".png");
- drawingNum ++;
- }
- }
I have also tried replacing line 5 with
- drawingArea.save("Hard Drive/Users/Andrew/Desktop/My Drawings/" + "My Drawing" + drawingNum + ".png");
It ended up creating a "Hard Drive" directory with all the Sub Directories in order and the final image file in place but the whole thing started in the sketch folder again.
Any help would be greatly appreciated.
Note... I am intermediate so any coding examples would aid to my understanding of an explanation.
1