public class TexturePaint extends Object implements Paint
TexturePaint类提供了一种填充Shape的方法 ,该纹理指定为BufferedImage 。
BufferedImage对象的大小应该很小,因为BufferedImage数据被TexturePaint对象复制。
在施工时,纹理锚定在用户空间中指定的Rectangle2D的左上角。
纹理被概念性地复制指定的计算在设备空间中的位置Rectangle2D无限在用户空间中的所有方向和映射BufferedImage到每个复制Rectangle2D 。
Paint , Graphics2D.setPaint(java.awt.Paint)
BITMASK, OPAQUE, TRANSLUCENT| Constructor and Description |
|---|
TexturePaint(BufferedImage txtr, Rectangle2D anchor)
构造一个
TexturePaint对象。
|
| Modifier and Type | Method and Description |
|---|---|
PaintContext |
createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
创建并返回一个用于生成平铺图像模式的 PaintContext 。
|
Rectangle2D |
getAnchorRect()
返回锚定矩形的副本,该矩形位置和尺寸纹理图像。
|
BufferedImage |
getImage()
返回用于填充形状的
BufferedImage纹理。
|
int |
getTransparency()
返回此透明度模式
TexturePaint 。
|
public TexturePaint(BufferedImage txtr, Rectangle2D anchor)
TexturePaint对象。
txtr - 具有用于绘画的纹理的
BufferedImage对象
anchor - 用户空间中的
Rectangle2D用于锚定和复制纹理
public BufferedImage getImage()
BufferedImage纹理。
BufferedImage 。
public Rectangle2D getAnchorRect()
Rectangle2D用于锚定和大小这个
TexturePaint 。
public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
PaintContext 。
有关空参数处理的信息,请参阅Paint接口中的方法的specification 。
createContext在界面
Paint
cm -优选ColorModel表示用于呼叫者接收的像素数据,或最方便的格式null如果没有偏好。
deviceBounds - 正在呈现的图形基元的设备空间边界框。
userBounds - 正在呈现的图形基元的用户空间边界框。
xform - 从用户空间到设备空间的AffineTransform 。
hints - 上下文对象可用于在呈现替代方案之间进行选择的一组提示。
PaintContext 。
Paint , PaintContext , ColorModel , Rectangle , Rectangle2D , AffineTransform , RenderingHints
public int getTransparency()
TexturePaint 。
getTransparency在界面
Transparency
TexturePaint作为整数值。
Transparency
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.