java.awt

Class TexturePaint

public class TexturePaint extends Object implements Paint

This class provides a way to fill a Shape with a texture that is specified by a BufferedImage.
Constructor Summary
TexturePaint(BufferedImage texture, Rectangle2D anchor)
Constructor.
Method Summary
PaintContextcreateContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
Creates the context used to paint the texture.
Rectangle2DgetAnchorRect()
Gets the shape anchor.
BufferedImagegetImage()
Gets the texture image.
intgetTransparency()
Returns the transparency mode.

Constructor Detail

TexturePaint

public TexturePaint(BufferedImage texture, Rectangle2D anchor)
Constructor.

Parameters: texture - the texture anchor - the shape

Method Detail

createContext

public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
Creates the context used to paint the texture.

Parameters: cm - the ColorModel that receives the Paint data. Used only as a hint. deviceBounds - the device space being rendered. userBounds - the user space being rendered xform - the AffineTransform from user space into device space hints - a RenderingHints object that is used to specify how the pattern is rendered

Returns: the paint context used to paint the texture

getAnchorRect

public Rectangle2D getAnchorRect()
Gets the shape anchor.

Returns: the shape anchor

getImage

public BufferedImage getImage()
Gets the texture image.

Returns: the texture

getTransparency

public int getTransparency()
Returns the transparency mode.

Returns: the transparency mode.