FileDocCategorySizeDatePackage
Image.javaAPI DocAndroid 1.5 API7173Wed May 06 22:41:54 BST 2009java.awt

Image

public abstract class Image extends Object
The Image abstract class represents the graphic images.
since
Android 1.0

Fields Summary
public static final Object
UndefinedProperty
The UndefinedProperty object should be returned if property is not defined for a particular image.
public static final int
SCALE_DEFAULT
The Constant SCALE_DEFAULT indicates the default image scaling algorithm.
public static final int
SCALE_FAST
The Constant SCALE_FAST indicates an image scaling algorithm which places a higher priority on scaling speed than on the image's smoothness.
public static final int
SCALE_SMOOTH
The Constant SCALE_SMOOTH indicates an image scaling algorithm which places a higher priority on image smoothness than on scaling speed.
public static final int
SCALE_REPLICATE
The Constant SCALE_REPLICATE indicates the image scaling algorithm in the ReplicateScaleFilter class.
public static final int
SCALE_AREA_AVERAGING
The Constant SCALE_AREA_AVERAGING indicates the area averaging image scaling algorithm.
protected float
accelerationPriority
The acceleration priority indicates image acceleration.
private static final ImageCapabilities
capabilities
The Constant capabilities.
Constructors Summary
Methods Summary
public abstract voidflush()
Flushes resources which are used by this Image object. This method resets the image to the reconstructed state from the image's source.

public floatgetAccelerationPriority()
Gets the acceleration priority of this image.

return
the acceleration priority of this image.

        return accelerationPriority;
    
public java.awt.ImageCapabilitiesgetCapabilities(java.awt.GraphicsConfiguration gc)
Gets an ImageCapabilities object of this Image object for the specified GraphicsConfiguration.

param
gc the specified GraphicsConfiguration object (null value means default GraphicsConfiguration).
return
an ImageCapabilities object of this Image object for the specified GraphicsConfiguration.

        // Note: common image is not accelerated.
        return capabilities;
    
public abstract java.awt.GraphicsgetGraphics()
Gets a Graphics object for rendering this image. This method can be used for off-screen images.

return
a Graphics object for rendering to this image.

public abstract intgetHeight(java.awt.image.ImageObserver observer)
Gets the height of this image. The specified ImageObserver object is notified when the height of this image is available.

param
observer the ImageObserver object which is is notified when the height of this image is available.
return
the height of image, or -1 if the height of this image is not available.

public abstract java.lang.ObjectgetProperty(java.lang.String name, java.awt.image.ImageObserver observer)
Gets the image property with the specified name. The UndefinedProperty object should be return if the property is not specified for this image. The return value should be null if the property is currently unknown yet and the specified ImageObserver is to be notified later.

param
name the name of image's property.
param
observer the ImageObserver.
return
the Object which represents value of the specified property.

public java.awt.ImagegetScaledInstance(int width, int height, int hints)
Gets the scaled instance of this Image. This method returns an Image object constructed from the source of this image with the specified width, height, and applied scaling algorithm.

param
width the width of scaled Image.
param
height the height of scaled Image.
param
hints the constant which indicates scaling algorithm.
return
the scaled Image.


                                                                                                  
          

                              
       

                                                                                             
        

                                                                                             
        

                                                                                                  
            
        ImageFilter filter;
        if ((hints & (SCALE_SMOOTH | SCALE_AREA_AVERAGING)) != 0) {
            filter = new AreaAveragingScaleFilter(width, height);
        } else {
            filter = new ReplicateScaleFilter(width, height);
        }
        ImageProducer producer = new FilteredImageSource(getSource(), filter);
        return Toolkit.getDefaultToolkit().createImage(producer);
    
public abstract java.awt.image.ImageProducergetSource()
Gets the ImageProducer object which represents data of this Image.

return
the ImageProducer object which represents data of this Image.

public abstract intgetWidth(java.awt.image.ImageObserver observer)
Gets the width of this image. The specified ImageObserver object is notified when the width of this image is available.

param
observer the ImageObserver object which is is notified when the width of this image is available.
return
the width of image, or -1 if the width of this image is not available.

public voidsetAccelerationPriority(float priority)
Sets the acceleration priority for this image.

param
priority the new acceleration priority (value in the range 0-1).

        if (priority < 0 || priority > 1) {
            // awt.10A=Priority must be a value between 0 and 1, inclusive
            throw new IllegalArgumentException(Messages.getString("awt.10A")); //$NON-NLS-1$
        }
        accelerationPriority = priority;