Adds a tile observer. If the observer is already present, it receives multiple notifications.
to | the specified TileObserver |
Computes an arbitrary rectangular region of the
BufferedImage and copies it into a specified
WritableRaster. The region to be computed is
determined from the bounds of the specified
WritableRaster. The specified
WritableRaster must have a
SampleModel that is compatible with this image. If
outRaster is null,
an appropriate WritableRaster is created.
outRaster | a WritableRaster to hold the returned
part of the image, or null |
WritableRaster.
Returns the ColorModel.
ColorModel of this
BufferedImage.
Returns the image as one large tile. The Raster
returned is a copy of the image data is not updated if the
image is changed.
Raster that is a copy of the image data.
setData(Raster)
Computes and returns an arbitrary region of the
BufferedImage. The Raster returned is a
copy of the image data and is not updated if the image is
changed.
rect | the region of the BufferedImage to be
returned. |
Raster that is a copy of the image data of
the specified region of the BufferedImage
setData(Raster)
This method returns a Graphics2D, but is here
for backwards compatibility. createGraphics is more
convenient, since it is declared to return a
Graphics2D.
Graphics2D, which can be used to draw into
this image.
Returns the height of the BufferedImage.
BufferedImage
Returns the height of the BufferedImage.
observer | ignored |
BufferedImage
Returns the minimum tile index in the x direction. This is always zero.
Returns the minimum tile index in the y direction. This is always zero.
Returns the minimum x coordinate of this
BufferedImage. This is always zero.
BufferedImage.
Returns the minimum y coordinate of this
BufferedImage. This is always zero.
BufferedImage.
Returns the number of tiles in the x direction. This is always one.
Returns the number of tiles in the y direction. This is always one.
Returns a property of the image by name.
name | the property name |
Object that is the property referred to by
the specified name.
Returns a property of the image by name. Individual property names
are defined by the various image formats. If a property is not
defined for a particular image, this method returns the
UndefinedProperty field. If the properties
for this image are not yet known, then this method returns
null and the ImageObserver object is
notified later. The property name "comment" should be used to
store an optional comment that can be presented to the user as a
description of the image, its source, or its author.
name | the property name | |
observer | the ImageObserver that receives
notification regarding image information |
Object that is the property referred to by the
specified name or null if the
properties of this image are not yet known.
ImageObserver, java.awt.Image.UndefinedProperty
Returns an array of names recognized by
getProperty(String)
or null, if no property names are recognized.
String array containing all of the property
names that getProperty(String) recognizes;
or null if no property names are recognized.
Returns the SampleModel associated with this
BufferedImage.
SampleModel of this
BufferedImage.
Returns the object that produces the pixels for the image.
ImageProducer that is used to produce the
pixels for this image.
ImageProducer
Returns a Vector of RenderedImage objects that are
the immediate sources, not the sources of these immediate sources,
of image data for this BufferedImage. This
method returns null if the BufferedImage
has no information about its immediate sources. It returns an
empty Vector if the BufferedImage has no
immediate sources.
Vector containing immediate sources of
this BufferedImage object's image date, or
null if this BufferedImage has
no information about its immediate sources, or an empty
Vector if this BufferedImage
has no immediate sources.
Returns tile (tileX, tileY). Note
that tileX and tileY are indices
into the tile array, not pixel locations. The Raster
that is returned is live, which means that it is updated if the
image is changed.
tileX | the x index of the requested tile in the tile array | |
tileY | the y index of the requested tile in the tile array |
Raster that is the tile defined by the
arguments tileX and tileY.
Returns the x offset of the tile grid relative to the origin, For example, the x coordinate of the location of tile (0, 0). This is always zero.
Returns the y offset of the tile grid relative to the origin, For example, the y coordinate of the location of tile (0, 0). This is always zero.
Returns the tile height in pixels.
Returns the tile width in pixels.
Returns the transparency. Returns either OPAQUE, BITMASK, or TRANSLUCENT.
BufferedImage.
Transparency.OPAQUE, Transparency.BITMASK, Transparency.TRANSLUCENT
Returns the width of the BufferedImage.
BufferedImage
Returns the width of the BufferedImage.
observer | ignored |
BufferedImage
Checks out a tile for writing. All registered
TileObservers are notified when a tile goes from having
no writers to having one writer.
tileX | the x index of the tile | |
tileY | the y index of the tile |
WritableRaster that is the tile, indicated by
the specified indices, to be checked out for writing.
Returns an array of Point objects indicating which tiles
are checked out for writing. Returns null if none are
checked out.
Point array that indicates the tiles that
are checked out for writing, or null if no
tiles are checked out for writing.
Returns whether or not any tile is checked out for writing. Semantically equivalent to
(getWritableTileIndices() != null).
true if any tile is checked out for writing;
false otherwise.
Returns whether or not a tile is currently checked out for writing.
tileX | the x index of the tile. | |
tileY | the y index of the tile. |
true if the tile specified by the specified
indices is checked out for writing; false
otherwise.
Relinquishes permission to write to a tile. If the caller
continues to write to the tile, the results are undefined.
Calls to this method should only appear in matching pairs
with calls to getWritableTile(int, int). Any other leads
to undefined results. All registered TileObservers
are notified when a tile goes from having one writer to having no
writers.
tileX | the x index of the tile | |
tileY | the y index of the tile |
Removes a tile observer. If the observer was not registered, nothing happens. If the observer was registered for multiple notifications, it is now registered for one fewer notification.
to | the specified TileObserver. |
Sets a rectangular region of the image to the contents of the
specified Raster r, which is
assumed to be in the same coordinate space as the
BufferedImage. The operation is clipped to the bounds
of the BufferedImage.
r | the specified Raster |
getData, getData(Rectangle)
Diagram: Image