Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.awt

Class Image

java.lang.Object
|
+--java.awt.Image


public abstract class Image

extends Object

This is the abstract superclass of all image objects in Java.

Since:Author:

Field Summary

static intSCALE_AREA_AVERAGING

Constant indicating that the area averaging scaling algorithm should be used.
static intSCALE_DEFAULT

Constant indicating that the default scaling algorithm should be used.
static intSCALE_FAST

Constant indicating that a fast scaling algorithm should be used.
static intSCALE_REPLICATE

Constant indicating that the ReplicateScaleFilter class algorithm should be used for scaling.
static intSCALE_SMOOTH

Constant indicating that a smooth scaling algorithm should be used.
static java.lang.ObjectUndefinedProperty

This variable is returned whenever a property that is not defined is requested.

Constructor Summary

Image()

A default constructor for subclasses.

Method Summary

voidflush()

Flushes (that is, destroys) any resources used for this image.
java.awt.GraphicsgetGraphics()

Returns a graphics context object for drawing an off-screen object.
intgetHeight(java.awt.image.ImageObserver observer)

Returns the height of the image, or -1 if it is unknown.
java.lang.ObjectgetProperty(java.lang.String name, java.awt.image.ImageObserver observer)

This method requests a named property for an object.
java.awt.ImagegetScaledInstance(int width, int height, int flags)

Scales the image to the requested dimension.
java.awt.image.ImageProducergetSource()

Returns the image producer object for this object.
intgetWidth(java.awt.image.ImageObserver observer)

Returns the width of the image, or -1 if it is unknown.

Field Details

SCALE_AREA_AVERAGING

public static final int SCALE_AREA_AVERAGING

Constant indicating that the area averaging scaling algorithm should be used.

Since:See Also:


SCALE_DEFAULT

public static final int SCALE_DEFAULT

Constant indicating that the default scaling algorithm should be used.

Since:

SCALE_FAST

public static final int SCALE_FAST

Constant indicating that a fast scaling algorithm should be used.

Since:

SCALE_REPLICATE

public static final int SCALE_REPLICATE

Constant indicating that the ReplicateScaleFilter class algorithm should be used for scaling.

Since:See Also:


SCALE_SMOOTH

public static final int SCALE_SMOOTH

Constant indicating that a smooth scaling algorithm should be used.

Since:

UndefinedProperty

public static final Object UndefinedProperty

This variable is returned whenever a property that is not defined is requested.


Constructor Details

Image

public Image()

A default constructor for subclasses.


Method Details

flush

public void flush()

Flushes (that is, destroys) any resources used for this image. This includes the actual image data.


getGraphics

public Graphics getGraphics()

Returns a graphics context object for drawing an off-screen object. This method is only valid for off-screen objects.

Returns:

See Also:


getHeight

public int getHeight(java.awt.image.ImageObserver observer)

Returns the height of the image, or -1 if it is unknown. If the image height is unknown, the observer object will be notified when the value is known.

Parameters:

Returns:

See Also:


getProperty

public Object getProperty(java.lang.String name, java.awt.image.ImageObserver observer)

This method requests a named property for an object. The value of the property is returned. The value UndefinedProperty is returned if there is no property with the specified name. The value null is returned if the properties for the object are not yet known. In this case, the specified image observer is notified when the properties are known.

Parameters:

Returns:

See Also:


getScaledInstance

public Image getScaledInstance(int width, int height, int flags)

Scales the image to the requested dimension. A new Image with asynchronous loading will be produced according to the hints of the algorithm requested. If either the width or height is non-positive, it is adjusted to preserve the original aspect ratio.

Since:Parameters:

Returns:

See Also:


getSource

public ImageProducer getSource()

Returns the image producer object for this object. The producer is the object which generates pixels for this image.

Returns:


getWidth

public int getWidth(java.awt.image.ImageObserver observer)

Returns the width of the image, or -1 if it is unknown. If the image width is unknown, the observer object will be notified when the value is known.

Parameters:

Returns:

See Also: