captcha.graphics
Class ImageFactory

java.lang.Object
  extended by captcha.graphics.ImageFactory

public class ImageFactory
extends java.lang.Object

This class creates Images using the BufferedImage implementation from Java 1.2 and above. This class can be compiled also within Java 1.1 but cannot be used there (because BufferedImage is not available within Java 1.1).


Constructor Summary
ImageFactory()
           
 
Method Summary
static java.awt.Image createImage(java.awt.image.ImageProducer a_imageProducer)
          Constructs a new Image (BufferedImage implementation) with the default color model (ARGB).
static java.awt.Image createImage(int a_width, int a_height)
          Constructs a new Image (BufferedImage implementation) with the default color model (ARGB).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageFactory

public ImageFactory()
Method Detail

createImage

public static java.awt.Image createImage(int a_width,
                                         int a_height)
Constructs a new Image (BufferedImage implementation) with the default color model (ARGB). If Java < 1.2 (no BufferedImage available) is used, null is returned.

Parameters:
a_width - The width of the new Image.
a_height - The height of the new Image.
Returns:
The created Image (BufferedImage implementation) or null, if there was an error while creating the new Image (e.g. Java < 1.2 is used).

createImage

public static java.awt.Image createImage(java.awt.image.ImageProducer a_imageProducer)
Constructs a new Image (BufferedImage implementation) with the default color model (ARGB). If Java < 1.2 (no BufferedImage available) is used, null is returned. The Image is filled with the data obtained from the specified ImageProducer.

Parameters:
a_imageProducer - The producer, which produces the image data.
Returns:
The created Image (BufferedImage implementation) or null, if there was an error while creating the new Image (e.g. Java < 1.2 is used).