jwo.utils.gui
Interface ImageHandler

All Known Implementing Classes:
BMPHandler, GIFHandler, JPGHandler, PNGHandler

public interface ImageHandler

Defines the behaviour of all image handlers. An image handler should be able to write a given image data as a file.

Version:
2.1, 10th August, 2003
Author:
Jo Wood

Method Summary
 boolean saveImage(String fileName, byte[] imageArray, int imgWidth, int imgHeight)
          Saves the given array of 24 bit colours as a file with the given name and dimensions.
 boolean saveImage(String fileName, Image image)
          Saves the given image as a file with the given name.
 

Method Detail

saveImage

public boolean saveImage(String fileName,
                         Image image)
Saves the given image as a file with the given name.

Parameters:
fileName - Name of image file to save.
image - Image to save.
Returns:
True if saved correctly, or false if problems saving.

saveImage

public boolean saveImage(String fileName,
                         byte[] imageArray,
                         int imgWidth,
                         int imgHeight)
Saves the given array of 24 bit colours as a file with the given name and dimensions.

Parameters:
fileName - Name of image file to save.
imageArray - BGR colours stored in byte array (3 bytes per colour).
imgWidth - Width of image to save.
imgHeight - Height of image to save.
Returns:
True if saved correctly, or false if problems saving.


Copyright Jo Wood, 1996-2004, last modified, 3rd September, 2004