public class RadialPattern extends Pattern
After calling this and before using the RadialPattern you need to call
addColorStopRGBA()
a few times to set up the gradient. For example, to
create an circular alpha blend:
pattern = new RadialPattern(75, 75, 25, 75, 75, 120); pattern.addColorStopRGBA(0.0, 0.0, 0.0, 0.0, 0.0); pattern.addColorStopRGBA(1.0, 0.0, 0.0, 0.0, 1.0);and then you can get on with using the Pattern in drawing operations:
cr.mask(pattern);
Constructor and Description |
---|
RadialPattern(double cx0,
double cy0,
double radius0,
double cx1,
double cy1,
double radius1)
Create a Pattern with a radial gradient between two circles.
|
addColorStopRGB, addColorStopRGBA, getSurface, setExtend, setFilter
public RadialPattern(double cx0, double cy0, double radius0, double cx1, double cy1, double radius1)
cx0
,cy0
with a radius
of radius0
, and the second circle is centered at
cx1
,cy1
with a radius of radius1
.
Quite typically, you will want a strict radial pattern from a common
centre, in which case have cx1
,cy1
equal to
cx0
,cy0
.