public class

OffScreenImage

extends BufferedImage
java.lang.Object
   ↳ java.awt.Image
     ↳ java.awt.image.BufferedImage
       ↳ sun.awt.image.OffScreenImage

Class Overview

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.

Summary

[Expand]
Inherited Constants
From class java.awt.image.BufferedImage
From class java.awt.Image
From interface java.awt.Transparency
Fields
protected Component c
[Expand]
Inherited Fields
From class java.awt.Image
Public Constructors
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.
Public Methods
Graphics2D createGraphics()
Creates a Graphics2D, which can be used to draw into this BufferedImage.
Graphics getGraphics()
This method returns a Graphics2D, but is here for backwards compatibility.
ImageProducer getSource()
Returns the object that produces the pixels for the image.
[Expand]
Inherited Methods
From class java.awt.image.BufferedImage
From class java.awt.Image
From class java.lang.Object
From interface java.awt.Transparency
From interface java.awt.image.RenderedImage
From interface java.awt.image.WritableRenderedImage

Fields

protected Component c

Public Constructors

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.

Public Methods

public Graphics2D createGraphics ()

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

Returns
  • a Graphics2D, used for drawing into this image.

public Graphics 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
  • a Graphics2D, which can be used to draw into this image.

public ImageProducer getSource ()

Returns the object that produces the pixels for the image.

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