petite/src/wombat/scheme/libraries/ImageAPI.java
public static ImageData readImage() throws IOException {
		FileDialog fc = new FileDialog((java.awt.Frame) null, "read-image", FileDialog.LOAD);
        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());
		return readImage(null, file.getCanonicalPath());
	}
/**
	 * Show a dialog to allow the user to choose an image, then read it into a byte stream.
	 * @param dir The directory to read from.
	 * @return A stream of encoded data. The first two values are rows then columns, then the sequence is [r,g,b,a] across rows then down.
	 * @throws IOException If we cannot read the file.
	 */
Show a dialog to allow the user to choose an image, then read it into a byte stream.
@param dir The directory to read from.
@return A stream of encoded data. The first two values are rows then columns, then the sequence is [r,g,b,a] across rows then down.
@throws IOException If we cannot read the file.
Show a dialog to allow the user to choose an image then read it into a byte stream . @param dir The directory to read from . @return A stream of encoded data . The first two values are rows then columns then the sequence is [ r g b a ] across rows then down . @throws IOException If we cannot read the file .
public static ImageData readImage() throws IOException {
		FileDialog fc = new FileDialog((java.awt.Frame) null, "read-image", FileDialog.LOAD);
        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());
		return readImage(null, file.getCanonicalPath());
	}
public static ImageData readImage ( ) throws IOException { FileDialog fc = new FileDialog ( ( java . awt . Frame ) null , "read-image" , FileDialog . LOAD ) ; 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 ( ) ) ; return readImage ( null , file . getCanonicalPath ( ) ) ; }
Show a dialog to allow the user to choose an image, then read it into a byte stream.
Show a dialog to allow the user to choose an image then read it into a byte stream .