Top Description Fields Constructors Methods
sun.awt.image

public Class OffScreenImage

extends BufferedImage
Class Inheritance
Imports
java.awt.Component, .Color, .SystemColor, .Font, .Graphics, .Graphics2D, .GraphicsEnvironment, java.awt.image.BufferedImage, .ImageProducer, .ColorModel, .WritableRaster, sun.java2d.SunGraphics2D, .SurfaceData

This is a special variant of BufferedImage that keeps a reference to a Component. The Component's foreground and background colors and default font are used as the defaults for this image.

Field Summary

Modifier and TypeField and Description
protected Component
c

private Font
private OffScreenImageSource
Inherited from java.awt.image.BufferedImage:
TYPE_3BYTE_BGRTYPE_4BYTE_ABGRTYPE_4BYTE_ABGR_PRETYPE_BYTE_BINARYTYPE_BYTE_GRAYTYPE_BYTE_INDEXEDTYPE_CUSTOMTYPE_INT_ARGBTYPE_INT_ARGB_PRETYPE_INT_BGRTYPE_INT_RGBTYPE_USHORT_555_RGBTYPE_USHORT_565_RGBTYPE_USHORT_GRAY

Constructor Summary

AccessConstructor and Description
public
OffScreenImage(Component c, ColorModel cm, WritableRaster raster, boolean isRasterPremultiplied)

Constructs an OffScreenImage given a color model and tile, for offscreen rendering to be used with a given component.

Method Summary

Modifier and TypeMethod and Description
public Graphics2D
createGraphics()

Overrides java.awt.image.BufferedImage.createGraphics.

Creates a Graphics2D, which can be used to draw into this BufferedImage.

public Graphics
getGraphics()

Overrides java.awt.image.BufferedImage.getGraphics.

This method returns a Graphics2D, but is here for backwards compatibility.

public ImageProducer
getSource()

Overrides java.awt.image.BufferedImage.getSource.

Returns the object that produces the pixels for the image.

private void
initSurface(int width, int height)

Inherited from java.awt.image.BufferedImage:
addTileObservercoerceDatacopyDatagetAlphaRastergetColorModelgetDatagetDatagetHeightgetHeightgetMinTileXgetMinTileYgetMinXgetMinYgetNumXTilesgetNumYTilesgetPropertygetPropertygetPropertyNamesgetRastergetRGBgetRGBgetSampleModelgetSourcesgetSubimagegetTilegetTileGridXOffsetgetTileGridYOffsetgetTileHeightgetTileWidthgetTransparencygetTypegetWidthgetWidthgetWritableTilegetWritableTileIndiceshasTileWritersisAlphaPremultipliedisTileWritablereleaseWritableTileremoveTileObserversetDatasetRGBsetRGBtoString

Field Detail

cback to summary
protected Component c
defaultFontback to summary
private Font defaultFont
osisback to summary
private OffScreenImageSource osis

Hides java.awt.image.BufferedImage.osis.

Constructor Detail

OffScreenImageback to summary
public OffScreenImage(Component c, ColorModel cm, WritableRaster raster, boolean isRasterPremultiplied)

Constructs an OffScreenImage given a color model and tile, for offscreen rendering to be used with a given component. The component is used to obtain the foreground color, background color and font.

Method Detail

createGraphicsback to summary
public Graphics2D createGraphics()

Overrides java.awt.image.BufferedImage.createGraphics.

Doc from java.awt.image.BufferedImage.createGraphics.

Creates a Graphics2D, which can be used to draw into this BufferedImage.

Returns:Graphics2D

a Graphics2D, used for drawing into this image.

getGraphicsback to summary
public Graphics getGraphics()

Overrides java.awt.image.BufferedImage.getGraphics.

Doc from java.awt.image.BufferedImage.getGraphics.

This method returns a Graphics2D, but is here for backwards compatibility. createGraphics is more convenient, since it is declared to return a Graphics2D.

Returns:Graphics

a Graphics2D, which can be used to draw into this image.

getSourceback to summary
public ImageProducer getSource()

Overrides java.awt.image.BufferedImage.getSource.

Doc from java.awt.image.BufferedImage.getSource.

Returns the object that produces the pixels for the image.

Returns:ImageProducer

the ImageProducer that is used to produce the pixels for this image.

initSurfaceback to summary
private void initSurface(int width, int height)