We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
Page Index Toggle Pages: 1
application (Read 869 times)
application
May 4th, 2006, 2:44pm
 
Is it possible to build an application (not an applet) with the following needs, in processing:
* load, resize, save images
* create and save a xml doc
* create folder
Re: application
Reply #1 - May 4th, 2006, 3:39pm
 
sure. although it sounds a little bit like it rather should be done in pure java .. anyway:

- filechooser: http://www.processinghacks.com/hacks/filechooser

- once you got a file-name & path you can use the loadImage and loadStrings, loadBytes

- saving: saveStrings , saveBytes, saveFrame (tif / tag) , seltar create jpeg (use with saveBytes) , shiffman create jpeg (use with saveBytes)

- create folder: Code:

// i think this is from java-almanach .. haven't tested it
// http://javaalmanac.com/egs/java.io/CreateDir.html
//

// Create a directory; all ancestor directories must exist
   boolean success = (new File("directoryName")).mkdir();
   if (!success) {
       // Directory creation failed
   }
   
   // Create a directory; all non-existent ancestor directories are
   // automatically created
   success = (new File("directoryName")).mkdirs();
   if (!success) {
       // Directory creation failed
   }


resizing shouldn't be a problem with PImage ...

best,
F
Re: application
Reply #2 - May 4th, 2006, 3:43pm
 
Thanks. I think for me its easier to do this in processing than in pure java.
Page Index Toggle Pages: 1