Could a linux user give me a hand ?
in
Programming Questions
•
3 years ago
Hi.
I wrote the folling code to save images at a specific path, chosed by the user.
It seems to work fine with Windows & OSX, but I'd like to test it under Unix.
Could somebody try it and tell me if it works with a Unix ?
There is nothing to do than to lauch the program, chose a directory, and then verify that there is a file called "test.png" in the chosen directory.
jn
-
void enregistre(PGraphics monImage, String fichier) {String chemin = selectFolder();String[] parties = split(chemin, "/");chemin = join(parties, "//");if(parties.length>1){chemin+="//";}String[] parties2 = split(chemin, "\\");chemin = join(parties2, "\\\\");if(parties2.length>1){chemin+="\\\\";}monImage.save(chemin+fichier);println("The file is saved here : "+chemin+fichier);}
void setup(){PGraphics monImage=createGraphics(500,500,P2D);monImage.beginDraw();monImage.smooth();for(int a=0;a<10;a++) {for(int b=0;b<10;b++) {monImage.ellipse(a*50+25, b*50+25, 25,25);}}monImage.endDraw();enregistre(monImage, "test.png");}
1
