public interface Paint extends Transparency
Paint
接口定义了颜色模式可以为
Graphics2D
操作生成。一个类实现
Paint
接口添加到为
Graphics2D
上下文定义的
draw
和
fill
方法使用色彩模式。
课程实施Paint
实例必须是只读的,Graphics2D
不复制这些对象时被设置为一个属性与setPaint
方法或当Graphics2D
对象本身是克隆。
PaintContext
,
Color
,
GradientPaint
,
TexturePaint
,
Graphics2D.setPaint(java.awt.Paint)
BITMASK, OPAQUE, TRANSLUCENT
Modifier and Type | Method and Description |
---|---|
PaintContext |
createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
创建并返回一个用来生成的彩色图案
PaintContext 。
|
getTransparency
PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
PaintContext
。这种方法传达渲染操作,可以使用或在
Paint
接口的各种实现忽略额外的信息参数。调用者必须通过non-
null
值的所有的参数除了
ColorModel
参数可
null
表示,没有具体的
ColorModel
型优先。
Paint
接口的实现允许使用或忽略任何的论点是有道理的,他们的功能,不受限制,使用指定的
PaintContext
ColorModel
返回,即使是不
null
。实现可以比其他任何
null
扔
NullPointerException
ColorModel
争论争论,但不需要这么做。
cm
-代表对方接收像素数据的首选
ColorModel
最方便的格式,或
null
如果没有偏好。
deviceBounds
-设备空间包围盒的图元被渲染。
Paint
接口的实现允许一
null
deviceBounds
扔
NullPointerException
。
userBounds
-用户空间包围盒的图元被渲染。
Paint
接口的实现允许一
null
userBounds
扔
NullPointerException
。
xform
-
AffineTransform
从用户空间到设备空间。
Paint
接口的实现允许一
null
xform
扔
NullPointerException
。
hints
-提示上下文对象可以使用之间的替代选择设置渲染。
Paint
接口的实现允许一
null
hints
扔
NullPointerException
。
PaintContext
。
PaintContext
,
ColorModel
,
Rectangle
,
Rectangle2D
,
AffineTransform
,
RenderingHints
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.