NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: saving images on a linux box

Hello,

A note for the archives. The following works with jdk1.4:

import javax.imageio.*;

...

FileOutputStream fos = new FileOutputStream(file);
ImageIO.write(display.getImage(),"JPG",fos);
fos.flush();
fos.close();

if you swap "JPG" for "PNG" the img is saved as such.

Cheers,

Ugo


  • 2003 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: