public class

BufferedImageGraphicsConfig

extends GraphicsConfiguration
java.lang.Object
   ↳ java.awt.GraphicsConfiguration
     ↳ sun.awt.image.BufferedImageGraphicsConfig

Summary

Public Constructors
BufferedImageGraphicsConfig(BufferedImage bufImg, Component comp)
Public Methods
BufferedImage createCompatibleImage(int width, int height)
Returns a BufferedImage with channel layout and color model compatible with this graphics configuration.
Rectangle getBounds()
Returns the bounds of the GraphicsConfiguration in the device coordinates.
ColorModel getColorModel(int transparency)
Returns the color model associated with this configuration that supports the specified transparency.
ColorModel getColorModel()
Returns the color model associated with this configuration.
static BufferedImageGraphicsConfig getConfig(BufferedImage bImg)
AffineTransform getDefaultTransform()
Returns the default Transform for this configuration.
GraphicsDevice getDevice()
Return the graphics device associated with this configuration.
AffineTransform getNormalizingTransform()
Returns a Transform that can be composed with the default Transform of a Graphics2D so that 72 units in user space will equal 1 inch in device space.
[Expand]
Inherited Methods
From class java.awt.GraphicsConfiguration
From class java.lang.Object

Public Constructors

public BufferedImageGraphicsConfig (BufferedImage bufImg, Component comp)

Public Methods

public BufferedImage createCompatibleImage (int width, int height)

Returns a BufferedImage with channel layout and color model compatible with this graphics configuration. This method has nothing to do with memory-mapping a device. This BufferedImage has a layout and color model that is closest to this native device configuration and thus can be optimally blitted to this device.

Parameters
width the width of the returned BufferedImage
height the height of the returned BufferedImage
Returns
  • a BufferedImage whose data layout and color model is compatible with this GraphicsConfiguration.

public Rectangle getBounds ()

Returns the bounds of the GraphicsConfiguration in the device coordinates. In a multi-screen environment with a virtual device, the bounds can have negative X or Y origins.

Returns
  • the bounds of the area covered by this GraphicsConfiguration.

public ColorModel getColorModel (int transparency)

Returns the color model associated with this configuration that supports the specified transparency.

Parameters
transparency the specified transparency mode
Returns
  • a ColorModel object that is associated with this GraphicsConfiguration and supports the specified transparency or null if the transparency is not a valid value.

public ColorModel getColorModel ()

Returns the color model associated with this configuration.

Returns
  • a ColorModel object that is associated with this GraphicsConfiguration.

public static BufferedImageGraphicsConfig getConfig (BufferedImage bImg)

public AffineTransform getDefaultTransform ()

Returns the default Transform for this configuration. This Transform is typically the Identity transform for most normal screens. Device coordinates for screen and printer devices will have the origin in the upper left-hand corner of the target region of the device, with X coordinates increasing to the right and Y coordinates increasing downwards. For image buffers, this Transform will be the Identity transform.

Returns
  • the default AffineTransform for this GraphicsConfiguration.

public GraphicsDevice getDevice ()

Return the graphics device associated with this configuration.

Returns
  • a GraphicsDevice object that is associated with this GraphicsConfiguration.

public AffineTransform getNormalizingTransform ()

Returns a Transform that can be composed with the default Transform of a Graphics2D so that 72 units in user space will equal 1 inch in device space. Given a Graphics2D, g, one can reset the transformation to create such a mapping by using the following pseudocode:

      GraphicsConfiguration gc = g.getGraphicsConfiguration();

      g.setTransform(gc.getDefaultTransform());
      g.transform(gc.getNormalizingTransform());
 
Note that sometimes this Transform will be identity (e.g. for printers or metafile output) and that this Transform is only as accurate as the information supplied by the underlying system. For image buffers, this Transform will be the Identity transform, since there is no valid distance measurement.

Returns
  • an AffineTransform to concatenate to the default AffineTransform so that 72 units in user space is mapped to 1 inch in device space.