java.awt.image
Class BufferedImage
public
class
BufferedImage
extends Image
implements WritableRenderedImage, Transparency
A buffered image always starts at coordinates (0, 0).
The buffered image is not subdivided into multiple tiles. Instead,
the image consists of one large tile (0,0) with the width and
height of the image. This tile is always considered to be checked
out.
Constructor Summary |
| BufferedImage(int width, int height, int type)
Creates a new BufferedImage with the specified width, height
and type. |
| BufferedImage(int w, int h, int type, IndexColorModel indexcolormodel) |
| BufferedImage(ColorModel colormodel, WritableRaster writableraster, boolean premultiplied, Hashtable<?,?> properties) |
Method Summary |
void | addTileObserver(TileObserver to)
Adds a tile observer. |
void | coerceData(boolean premultiplied) |
WritableRaster | copyData(WritableRaster dest) |
Graphics2D | createGraphics() |
void | flush() |
WritableRaster | getAlphaRaster() |
ColorModel | getColorModel() |
Raster | getData() |
Raster | getData(Rectangle rectangle) |
Graphics | getGraphics() |
int | getHeight() |
int | getHeight(ImageObserver imageobserver) |
int | getMinTileX() |
int | getMinTileY() |
int | getMinX() |
int | getMinY() |
int | getNumXTiles() |
int | getNumYTiles() |
Object | getProperty(String string)
Returns the value of the specified property, or
UndefinedProperty if the property is not defined.
|
Object | getProperty(String string, ImageObserver imageobserver) |
String[] | getPropertyNames()
Returns null always.
|
WritableRaster | getRaster() |
int | getRGB(int x, int y) |
int[] | getRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scanlineStride) |
SampleModel | getSampleModel() |
ImageProducer | getSource() |
Vector<RenderedImage> | getSources() |
BufferedImage | getSubimage(int x, int y, int w, int h) |
Raster | getTile(int tileX, int tileY) |
int | getTileGridXOffset() |
int | getTileGridYOffset() |
int | getTileHeight() |
int | getTileWidth() |
int | getTransparency()
Return the transparency type.
|
int | getType() |
int | getWidth() |
int | getWidth(ImageObserver imageobserver) |
WritableRaster | getWritableTile(int tileX, int tileY) |
Point[] | getWritableTileIndices() |
boolean | hasTileWriters() |
boolean | isAlphaPremultiplied() |
boolean | isTileWritable(int tileX, int tileY) |
void | releaseWritableTile(int tileX, int tileY) |
void | removeTileObserver(TileObserver to)
Removes a tile observer. |
void | setData(Raster src) |
void | setRGB(int x, int y, int argb) |
void | setRGB(int startX, int startY, int w, int h, int[] argbArray, int offset, int scanlineStride) |
String | toString() |
public static final int TYPE_3BYTE_BGR
public static final int TYPE_4BYTE_ABGR
public static final int TYPE_4BYTE_ABGR_PRE
public static final int TYPE_BYTE_BINARY
public static final int TYPE_BYTE_GRAY
public static final int TYPE_BYTE_INDEXED
public static final int TYPE_CUSTOM
public static final int TYPE_INT_ARGB
public static final int TYPE_INT_ARGB_PRE
public static final int TYPE_INT_BGR
public static final int TYPE_INT_RGB
public static final int TYPE_USHORT_555_RGB
public static final int TYPE_USHORT_565_RGB
public static final int TYPE_USHORT_GRAY
public BufferedImage(int width, int height, int type)
Creates a new
BufferedImage
with the specified width, height
and type. Valid
type
values are:
Parameters: width the width (must be > 0). height the height (must be > 0). type the image type (see the list of valid types above).
Throws: IllegalArgumentException if width
or
height
is less than or equal to zero. IllegalArgumentException if type
is not one of the
specified values.
public BufferedImage(int w, int h, int type,
IndexColorModel indexcolormodel)
Adds a tile observer. If the observer is already present, it receives
multiple notifications.
Parameters: to The TileObserver to add.
public void coerceData(boolean premultiplied)
public void flush()
public int getHeight()
public int getMinTileX()
public int getMinTileY()
public int getMinX()
public int getMinY()
public int getNumXTiles()
public int getNumYTiles()
Returns the value of the specified property, or
UndefinedProperty if the property is not defined.
Parameters: string the property key (null
not permitted).
Returns: The property value.
Throws: NullPointerException if string
is null
.
public
String[] getPropertyNames()
Returns
null
always.
Returns: null
always.
public int getRGB(int x, int y)
public int[] getRGB(int startX, int startY, int w, int h, int[] rgbArray, int offset, int scanlineStride)
public
Raster getTile(int tileX, int tileY)
public int getTileGridXOffset()
public int getTileGridYOffset()
public int getTileHeight()
public int getTileWidth()
public int getTransparency()
public int getType()
public int getWidth()
public
Point[] getWritableTileIndices()
public boolean hasTileWriters()
public boolean isAlphaPremultiplied()
public boolean isTileWritable(int tileX, int tileY)
public void releaseWritableTile(int tileX, int tileY)
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.
Parameters: to The TileObserver to remove.
public void setData(
Raster src)
public void setRGB(int x, int y, int argb)
public void setRGB(int startX, int startY, int w, int h, int[] argbArray, int offset, int scanlineStride)