Java Reference
In-Depth Information
ated
AlphaComposite
instanceconstantsnamed
Clear
,
Dst
,
DstAtop
,
DstIn
,
DstOut
,
DstOver
,
Src
,
SrcAtop
,
SrcIn
,
SrcOut
,
SrcOver
, and
Xor
.
Thedifferencebetweenthesetwosetsofconstantshastodowithalphavalues.The
precreated
AlphaComposite
instances are wired to an alpha value of 1.0 (opaque).
The integer constants and specific floating-point alpha values can be passed to
AlphaComposite
's
AlphaComposite getInstance(int rule, float
alpha)
class method. This alpha value is used to modify the opacity or coverage of
everysourcepixelbeforeit'susedintheblendingequationsdescribedin
AlphaCom-
posite
's Java documentation.
Figure 7-22
shows the results of applying these rules.
Figure 7-22.
Select Composite Rule from the Demo menu to view the composite rule
demonstration.
Figure 7-22
shows you the rules with an alpha value of 1.0. However, you can also
vary the alpha value by using
getInstance(int rule, float alpha)
. I