petite/src/wombat/scheme/libraries/ImageAPI.java
public static void writeImage(Image img) throws IOException {
		FileDialog fc = new FileDialog((java.awt.Frame) null, "write-image", FileDialog.SAVE);
        fc.setVisible(true);

        if (fc.getFile() == null)
        	throw new IllegalArgumentException("Error in read-image: no image chosen");

        File file = new File(fc.getDirectory(), fc.getFile());
		
		String[] parts = file.getName().split("\\.");
		ImageIO.write((RenderedImage) img, parts[parts.length - 1], file);
	}
/**
	 * Write the image. Display a dialog for the filename.
	 * @param dir The directory to read from.
	 * @param data The image to write.
	 * @throws IOException If we cannot write the image.
	 */
Write the image. Display a dialog for the filename.
@param dir The directory to read from.
@param data The image to write.
@throws IOException If we cannot write the image.
Write the image . Display a dialog for the filename . @param dir The directory to read from . @param data The image to write . @throws IOException If we cannot write the image .
public static void writeImage(Image img) throws IOException {
		FileDialog fc = new FileDialog((java.awt.Frame) null, "write-image", FileDialog.SAVE);
        fc.setVisible(true);
        if (fc.getFile() == null)
        	throw new IllegalArgumentException("Error in read-image: no image chosen");
        File file = new File(fc.getDirectory(), fc.getFile());
		String[] parts = file.getName().split("\\.");
		ImageIO.write((RenderedImage) img, parts[parts.length - 1], file);
	}
public static void writeImage ( Image img ) throws IOException { FileDialog fc = new FileDialog ( ( java . awt . Frame ) null , "write-image" , FileDialog . SAVE ) ; fc . setVisible ( true ) ; if ( fc . getFile ( ) == null ) throw new IllegalArgumentException ( "Error in read-image: no image chosen" ) ; File file = new File ( fc . getDirectory ( ) , fc . getFile ( ) ) ; String [ ] parts = file . getName ( ) . split ( "\\." ) ; ImageIO . write ( ( RenderedImage ) img , parts [ parts . length - 1 ] , file ) ; }
Write the image.
Write the image .