public final class LinearGradientBrush extends LinearGradientBrushBase
Encapsulates a Brush
with a linear gradient. This class cannot be inherited.
Constructor and Description |
---|
LinearGradientBrush()
Initializes a new instance of the
LinearGradientBrush class with default parameters. |
LinearGradientBrush(PointF point1,
PointF point2,
Color color1,
Color color2)
Initializes a new instance of the
LinearGradientBrush class with the specified points and colors. |
LinearGradientBrush(Point point1,
Point point2,
Color color1,
Color color2)
Initializes a new instance of the
LinearGradientBrush class with the specified points and colors. |
LinearGradientBrush(Rectangle rect,
Color color1,
Color color2,
float angle)
Initializes a new instance of the
LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle. |
LinearGradientBrush(Rectangle rect,
Color color1,
Color color2,
float angle,
boolean isAngleScalable)
Initializes a new instance of the
LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle. |
LinearGradientBrush(RectangleF rect,
Color color1,
Color color2,
float angle)
Initializes a new instance of the
LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle. |
LinearGradientBrush(RectangleF rect,
Color color1,
Color color2,
float angle,
boolean isAngleScalable)
Initializes a new instance of the
LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle. |
Modifier and Type | Method and Description |
---|---|
Blend |
getBlend()
Gets or sets a
Blend that specifies positions and factors that define a custom falloff for the gradient. |
Color |
getEndColor()
Gets or sets the ending gradient color.
|
ColorBlend |
getInterpolationColors()
Deprecated.
This property is not used anymore in this class. Use instance of the LinearMulticolorGradientBrush class instead.
|
Color[] |
getLinearColors()
Deprecated.
Use StartColor and EndColor properties instead.
|
Color |
getStartColor()
Gets or sets the starting gradient color.
|
void |
setBlend(Blend value)
Gets or sets a
Blend that specifies positions and factors that define a custom falloff for the gradient. |
void |
setBlendTriangularShape(float focus)
Creates a linear gradient with a center color and a linear falloff to a single color on both ends.
|
void |
setBlendTriangularShape(float focus,
float scale)
Creates a linear gradient with a center color and a linear falloff to a single color on both ends.
|
void |
setEndColor(Color value)
Gets or sets the ending gradient color.
|
void |
setInterpolationColors(ColorBlend value)
Deprecated.
This property is not used anymore in this class. Use instance of the LinearMulticolorGradientBrush class instead.
|
void |
setLinearColors(Color[] value)
Deprecated.
Use StartColor and EndColor properties instead.
|
void |
setSigmaBellShape(float focus)
Creates a gradient falloff based on a bell-shaped curve.
|
void |
setSigmaBellShape(float focus,
float scale)
Creates a gradient falloff based on a bell-shaped curve.
|
void |
setStartColor(Color value)
Gets or sets the starting gradient color.
|
getAngle, getGammaCorrection, getRectangle, isAngleScalable, setAngle, setAngleScalable, setGammaCorrection, setRectangle
getTransform, getWrapMode, isTransformChanged, multiplyTransform, multiplyTransform, resetTransform, rotateTransform, rotateTransform, scaleTransform, scaleTransform, setTransform, setWrapMode, translateTransform, translateTransform
deepClone, getOpacity, setOpacity
dispose, getDisposed
public LinearGradientBrush()
Initializes a new instance of the LinearGradientBrush
class with default parameters.
The starting color is black, the ending color is white, the angle is 45 degrees and the rectangle is located in (0,0) with size (1,1).
public LinearGradientBrush(Point point1, Point point2, Color color1, Color color2)
Initializes a new instance of the LinearGradientBrush
class with the specified points and colors.
point1
- A Point
structure that represents the starting point of the linear gradient.point2
- A Point
structure that represents the endpoint of the linear gradient.color1
- A Color
structure that represents the starting color of the linear gradient.color2
- A Color
structure that represents the ending color of the linear gradient.public LinearGradientBrush(PointF point1, PointF point2, Color color1, Color color2)
Initializes a new instance of the LinearGradientBrush
class with the specified points and colors.
point1
- A PointF
structure that represents the starting point of the linear gradient.point2
- A PointF
structure that represents the endpoint of the linear gradient.color1
- A Color
structure that represents the starting color of the linear gradient.color2
- A Color
structure that represents the ending color of the linear gradient.public LinearGradientBrush(Rectangle rect, Color color1, Color color2, float angle)
Initializes a new instance of the LinearGradientBrush
class based on a rectangle, starting and ending colors, and an orientation angle.
rect
- A RectangleF
structure that specifies the bounds of the linear gradient.color1
- A Color
structure that represents the starting color for the gradient.color2
- A Color
structure that represents the ending color for the gradient.angle
- The angle, measured in degrees clockwise from the x-axis, of the gradient's orientation line.public LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle)
Initializes a new instance of the LinearGradientBrush
class based on a rectangle, starting and ending colors, and an orientation angle.
rect
- A RectangleF
structure that specifies the bounds of the linear gradient.color1
- A Color
structure that represents the starting color for the gradient.color2
- A Color
structure that represents the ending color for the gradient.angle
- The angle, measured in degrees clockwise from the x-axis, of the gradient's orientation line.public LinearGradientBrush(Rectangle rect, Color color1, Color color2, float angle, boolean isAngleScalable)
Initializes a new instance of the LinearGradientBrush
class based on a rectangle, starting and ending colors, and an orientation angle.
rect
- A RectangleF
structure that specifies the bounds of the linear gradient.color1
- A Color
structure that represents the starting color for the gradient.color2
- A Color
structure that represents the ending color for the gradient.angle
- The angle, measured in degrees clockwise from the x-axis, of the gradient's orientation line.isAngleScalable
- if set to true
the angle is changed during transformations with this LinearGradientBrush
.public LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle, boolean isAngleScalable)
Initializes a new instance of the LinearGradientBrush
class based on a rectangle, starting and ending colors, and an orientation angle.
rect
- A RectangleF
structure that specifies the bounds of the linear gradient.color1
- A Color
structure that represents the starting color for the gradient.color2
- A Color
structure that represents the ending color for the gradient.angle
- The angle, measured in degrees clockwise from the x-axis, of the gradient's orientation line.isAngleScalable
- if set to true
the angle is changed during transformations with this LinearGradientBrush
.@Deprecated public final ColorBlend getInterpolationColors()
Gets or sets a ColorBlend
that defines a multicolor linear gradient.
ColorBlend
that defines a multicolor linear gradient.@Deprecated public final void setInterpolationColors(ColorBlend value)
Gets or sets a ColorBlend
that defines a multicolor linear gradient.
ColorBlend
that defines a multicolor linear gradient.@Deprecated public final Color[] getLinearColors()
Gets or sets the starting and ending colors of the gradient.
Value: An array of twoColor
structures that represents the starting and ending colors of the gradient.@Deprecated public final void setLinearColors(Color[] value)
Gets or sets the starting and ending colors of the gradient.
Value: An array of twoColor
structures that represents the starting and ending colors of the gradient.public final Color getStartColor()
Gets or sets the starting gradient color.
Value: The starting gradient color.public final void setStartColor(Color value)
Gets or sets the starting gradient color.
Value: The starting gradient color.public final Color getEndColor()
Gets or sets the ending gradient color.
Value: The ending gradient color.public final void setEndColor(Color value)
Gets or sets the ending gradient color.
Value: The ending gradient color.public final Blend getBlend()
Gets or sets a Blend
that specifies positions and factors that define a custom falloff for the gradient.
Blend
that represents a custom falloff for the gradient.public final void setBlend(Blend value)
Gets or sets a Blend
that specifies positions and factors that define a custom falloff for the gradient.
Blend
that represents a custom falloff for the gradient.public final void setSigmaBellShape(float focus)
Creates a gradient falloff based on a bell-shaped curve.
focus
- A value from 0 through 1 that specifies the center of the gradient (the point where the starting color and ending color are blended equally).public final void setSigmaBellShape(float focus, float scale)
Creates a gradient falloff based on a bell-shaped curve.
focus
- A value from 0 through 1 that specifies the center of the gradient (the point where the gradient is composed of only the ending color).scale
- A value from 0 through 1 that specifies how fast the colors falloff from the focus
.public final void setBlendTriangularShape(float focus)
Creates a linear gradient with a center color and a linear falloff to a single color on both ends.
focus
- A value from 0 through 1 that specifies the center of the gradient (the point where the gradient is composed of only the ending color).public final void setBlendTriangularShape(float focus, float scale)
Creates a linear gradient with a center color and a linear falloff to a single color on both ends.
focus
- A value from 0 through 1 that specifies the center of the gradient (the point where the gradient is composed of only the ending color).scale
- A value from 0 through1 that specifies how fast the colors falloff from the starting color to focus
(ending color)Copyright (c) 2008-2019 Aspose Pty Ltd. All Rights Reserved.