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: