public class GradientBrush extends Brush
Constructor and Description |
---|
GradientBrush()
Initializes a new instance of the
GradientBrush class. |
GradientBrush(Color color1,
Color color2,
int angle)
Initializes a new instance of the
GradientBrush class. |
GradientBrush(float[] fractions,
Color[] colors,
int angle)
Initializes a new instance of the
GradientBrush class. |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Creates a clone of the brush.
|
android.graphics.Paint |
createPaint(android.graphics.RectF bounds)
Creates android.graphics.Paint object corresponding to this brush.
|
int |
getAngle()
Gets the gradient orientation angle.
|
Color |
getColor1()
Gets the first gradient color.
|
Color |
getColor2()
Gets the second gradient color.
|
Color[] |
getColors() |
float[] |
getFractions() |
void |
readExternal(java.io.ObjectInput in)
Implements Externalizable.
|
void |
setColor1(Color value)
Sets the first gradient color.
|
void |
setColor2(Color value)
Sets the second gradient color.
|
void |
setColors(Color[] value) |
void |
setFractions(float[] value) |
void |
writeExternal(java.io.ObjectOutput out)
Implements Externalizable.
|
public GradientBrush(Color color1, Color color2, int angle)
GradientBrush
class.color1
- A Color
object representing
the start color of the gradient.color2
- A Color
object representing
the end color of the gradient.angle
- An integer value specifying the gradient orientation.public GradientBrush(float[] fractions, Color[] colors, int angle)
GradientBrush
class.
Instances of the GradientBrush class created using this constructor
are currently not serialized.fractions
- An array of float numbers specifying the positions
of the colors along the gradient.colors
- An array of Color
objects representing
the colors of the gradient.angle
- An integer value specifying the gradient orientation.public GradientBrush()
GradientBrush
class.public java.lang.Object clone()
public Color getColor1()
Color
object representing the fill color.public void setColor1(Color value)
value
- A Color
object representing the fill color.public Color getColor2()
Color
object representing the fill color.public void setColor2(Color value)
value
- A Color
object representing the fill color.public int getAngle()
public float[] getFractions()
public void setFractions(float[] value)
public Color[] getColors()
public void setColors(Color[] value)
public android.graphics.Paint createPaint(android.graphics.RectF bounds)
Brush
createPaint
in class Brush
bounds
- The bounds of the area where this brush will be applied.public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException