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)
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.