LinearGradientBrush
Inheritance: java.lang.Object, com.aspose.drawing.Brush
public final class LinearGradientBrush extends Brush
Encapsulates a Brush with a linear gradient. This class cannot be inherited.
Constructors
Constructor | Description |
---|---|
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(RectangleF rect, Color color1, Color color2, int linearGradientMode) | Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation mode. |
LinearGradientBrush(Rectangle rect, Color color1, Color color2, int linearGradientMode) | Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and orientation. |
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 isAngleScaleable) | 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) | 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 isAngleScaleable) | Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle. |
Methods
Method | Description |
---|---|
getLinearColors() | Gets or sets the starting and ending colors of the gradient. |
setLinearColors(Color[] value) | Gets or sets the starting and ending colors of the gradient. |
getRectangle() | Gets a rectangular region that defines the starting and ending points of the gradient. |
getGammaCorrection() | Gets or sets a value indicating whether gamma correction is enabled for this LinearGradientBrush. |
setGammaCorrection(boolean value) | Gets or sets a value indicating whether gamma correction is enabled for this LinearGradientBrush. |
getBlend() | Gets or sets a Blend (.getBlend/.setBlend(Blend)) that specifies positions and factors that define a custom falloff for the gradient. |
setBlend(Blend value) | Gets or sets a Blend (.getBlend/.setBlend(Blend)) that specifies positions and factors that define a custom falloff for the gradient. |
getInterpolationColors() | Gets or sets a ColorBlend that defines a multicolor linear gradient. |
setInterpolationColors(ColorBlend value) | Gets or sets a ColorBlend that defines a multicolor linear gradient. |
getWrapMode() | Gets or sets a WrapMode enumeration that indicates the wrap mode for this LinearGradientBrush. |
setWrapMode(int value) | Gets or sets a WrapMode enumeration that indicates the wrap mode for this LinearGradientBrush. |
getTransform() | Gets or sets a copy Matrix that defines a local geometric transform for this LinearGradientBrush. |
setTransform(Matrix value) | Gets or sets a copy Matrix that defines a local geometric transform for this LinearGradientBrush. |
deepClone() | Creates an exact copy of this LinearGradientBrush. |
setSigmaBellShape(float focus) | Creates a gradient falloff based on a bell-shaped curve. |
setSigmaBellShape(float focus, float scale) | Creates a gradient falloff based on a bell-shaped curve. |
setBlendTriangularShape(float focus) | Creates a linear gradient with a center color and a linear falloff to a single color on both ends. |
setBlendTriangularShape(float focus, float scale) | Creates a linear gradient with a center color and a linear falloff to a single color on both ends. |
resetTransform() | Resets the LinearGradientBrush.Transform property to identity. |
multiplyTransform(Matrix matrix) | Multiplies the Matrix that represents the local geometric transform of this LinearGradientBrush by the specified Matrix by prepending the specified Matrix. |
multiplyTransform(Matrix matrix, int order) | Multiplies the Matrix that represents the local geometric transform of this LinearGradientBrush by the specified Matrix in the specified order. |
translateTransform(float dx, float dy) | Translates the local geometric transform by the specified dimensions. |
translateTransform(float dx, float dy, int order) | Translates the local geometric transform by the specified dimensions in the specified order. |
scaleTransform(float sx, float sy) | Scales the local geometric transform by the specified amounts. |
scaleTransform(float sx, float sy, int order) | Scales the local geometric transform by the specified amounts in the specified order. |
rotateTransform(float angle) | Rotates the local geometric transform by the specified amount. |
rotateTransform(float angle, int order) | Rotates the local geometric transform by the specified amount in the specified order. |
LinearGradientBrush(PointF point1, PointF point2, Color color1, Color color2)
public LinearGradientBrush(PointF point1, PointF point2, Color color1, Color color2)
Initializes a new instance of the LinearGradientBrush class with the specified points and colors.
Parameters:
Parameter | Type | Description |
---|---|---|
point1 | PointF | A PointF structure that represents the starting point of the linear gradient. |
point2 | PointF | A PointF structure that represents the endpoint of the linear gradient. |
color1 | Color | A Color structure that represents the starting color of the linear gradient. |
color2 | Color | A Color structure that represents the ending color of the linear gradient. |
LinearGradientBrush(Point point1, Point point2, Color color1, Color color2)
public LinearGradientBrush(Point point1, Point point2, Color color1, Color color2)
Initializes a new instance of the LinearGradientBrush class with the specified points and colors.
Parameters:
Parameter | Type | Description |
---|---|---|
point1 | Point | A Point structure that represents the starting point of the linear gradient. |
point2 | Point | A Point structure that represents the endpoint of the linear gradient. |
color1 | Color | A Color structure that represents the starting color of the linear gradient. |
color2 | Color | A Color structure that represents the ending color of the linear gradient. |
LinearGradientBrush(RectangleF rect, Color color1, Color color2, int linearGradientMode)
public LinearGradientBrush(RectangleF rect, Color color1, Color color2, int linearGradientMode)
Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation mode.
Parameters:
Parameter | Type | Description |
---|---|---|
rect | RectangleF | A RectangleF structure that specifies the bounds of the linear gradient. |
color1 | Color | A Color structure that represents the starting color for the gradient. |
color2 | Color | A Color structure that represents the ending color for the gradient. |
linearGradientMode | int | A LinearGradientMode enumeration element that specifies the orientation of the gradient. The orientation determines the starting and ending points of the gradient. For example, LinearGradientMode.ForwardDiagonal specifies that the starting point is the upper-left corner of the rectangle and the ending point is the lower-right corner of the rectangle. |
LinearGradientBrush(Rectangle rect, Color color1, Color color2, int linearGradientMode)
public LinearGradientBrush(Rectangle rect, Color color1, Color color2, int linearGradientMode)
Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and orientation.
Parameters:
Parameter | Type | Description |
---|---|---|
rect | Rectangle | A Rectangle (.getRectangle) structure that specifies the bounds of the linear gradient. |
color1 | Color | A Color structure that represents the starting color for the gradient. |
color2 | Color | A Color structure that represents the ending color for the gradient. |
linearGradientMode | int | A LinearGradientMode enumeration element that specifies the orientation of the gradient. The orientation determines the starting and ending points of the gradient. For example, LinearGradientMode.ForwardDiagonal specifies that the starting point is the upper-left corner of the rectangle and the ending point is the lower-right corner of the rectangle. |
LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle)
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.
Parameters:
Parameter | Type | Description |
---|---|---|
rect | RectangleF | A RectangleF structure that specifies the bounds of the linear gradient. |
color1 | Color | A Color structure that represents the starting color for the gradient. |
color2 | Color | A Color structure that represents the ending color for the gradient. |
angle | float | The angle, measured in degrees clockwise from the x-axis, of the gradient’s orientation line. |
LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle, boolean isAngleScaleable)
public LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle, boolean isAngleScaleable)
Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle.
Parameters:
Parameter | Type | Description |
---|---|---|
rect | RectangleF | A RectangleF structure that specifies the bounds of the linear gradient. |
color1 | Color | A Color structure that represents the starting color for the gradient. |
color2 | Color | A Color structure that represents the ending color for the gradient. |
angle | float | The angle, measured in degrees clockwise from the x-axis, of the gradient’s orientation line. |
isAngleScaleable | boolean | Set to true to specify that the angle is affected by the transform associated with this LinearGradientBrush; otherwise, false. |
LinearGradientBrush(Rectangle rect, Color color1, Color color2, float angle)
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.
Parameters:
Parameter | Type | Description |
---|---|---|
rect | Rectangle | A Rectangle (.getRectangle) structure that specifies the bounds of the linear gradient. |
color1 | Color | A Color structure that represents the starting color for the gradient. |
color2 | Color | A Color structure that represents the ending color for the gradient. |
angle | float | The angle, measured in degrees clockwise from the x-axis, of the gradient’s orientation line. |
LinearGradientBrush(Rectangle rect, Color color1, Color color2, float angle, boolean isAngleScaleable)
public LinearGradientBrush(Rectangle rect, Color color1, Color color2, float angle, boolean isAngleScaleable)
Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle.
Parameters:
Parameter | Type | Description |
---|---|---|
rect | Rectangle | A Rectangle (.getRectangle) structure that specifies the bounds of the linear gradient. |
color1 | Color | A Color structure that represents the starting color for the gradient. |
color2 | Color | A Color structure that represents the ending color for the gradient. |
angle | float | The angle, measured in degrees clockwise from the x-axis, of the gradient’s orientation line. |
isAngleScaleable | boolean | Set to true to specify that the angle is affected by the transform associated with this LinearGradientBrush; otherwise, false. |
getLinearColors()
public Color[] getLinearColors()
Gets or sets the starting and ending colors of the gradient.
Returns: com.aspose.drawing.Color[]
setLinearColors(Color[] value)
public void setLinearColors(Color[] value)
Gets or sets the starting and ending colors of the gradient.
Parameters:
Parameter | Type | Description |
---|---|---|
value | Color[] |
getRectangle()
public RectangleF getRectangle()
Gets a rectangular region that defines the starting and ending points of the gradient.
Returns: RectangleF
getGammaCorrection()
public boolean getGammaCorrection()
Gets or sets a value indicating whether gamma correction is enabled for this LinearGradientBrush.
Returns: boolean
setGammaCorrection(boolean value)
public void setGammaCorrection(boolean value)
Gets or sets a value indicating whether gamma correction is enabled for this LinearGradientBrush.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
getBlend()
public Blend getBlend()
Gets or sets a Blend
(.getBlend/.setBlend(Blend)) that specifies positions and factors that define a custom falloff for the gradient.
Returns: Blend
setBlend(Blend value)
public void setBlend(Blend value)
Gets or sets a Blend
(.getBlend/.setBlend(Blend)) that specifies positions and factors that define a custom falloff for the gradient.
Parameters:
Parameter | Type | Description |
---|---|---|
value | Blend |
getInterpolationColors()
public ColorBlend getInterpolationColors()
Gets or sets a ColorBlend that defines a multicolor linear gradient.
Returns: ColorBlend
setInterpolationColors(ColorBlend value)
public void setInterpolationColors(ColorBlend value)
Gets or sets a ColorBlend that defines a multicolor linear gradient.
Parameters:
Parameter | Type | Description |
---|---|---|
value | ColorBlend |
getWrapMode()
public int getWrapMode()
Gets or sets a WrapMode
enumeration that indicates the wrap mode for this LinearGradientBrush.
Returns: int
setWrapMode(int value)
public void setWrapMode(int value)
Gets or sets a WrapMode
enumeration that indicates the wrap mode for this LinearGradientBrush.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
getTransform()
public Matrix getTransform()
Gets or sets a copy Matrix that defines a local geometric transform for this LinearGradientBrush.
Returns: Matrix
setTransform(Matrix value)
public void setTransform(Matrix value)
Gets or sets a copy Matrix that defines a local geometric transform for this LinearGradientBrush.
Parameters:
Parameter | Type | Description |
---|---|---|
value | Matrix |
deepClone()
public Object deepClone()
Creates an exact copy of this LinearGradientBrush.
Returns: java.lang.Object - The LinearGradientBrush this method creates, cast as an object.
setSigmaBellShape(float focus)
public void setSigmaBellShape(float focus)
Creates a gradient falloff based on a bell-shaped curve.
Parameters:
Parameter | Type | Description |
---|---|---|
focus | float | 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). |
setSigmaBellShape(float focus, float scale)
public void setSigmaBellShape(float focus, float scale)
Creates a gradient falloff based on a bell-shaped curve.
Parameters:
Parameter | Type | Description |
---|---|---|
focus | float | 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 | float | A value from 0 through 1 that specifies how fast the colors falloff from the focus . |
setBlendTriangularShape(float focus)
public void setBlendTriangularShape(float focus)
Creates a linear gradient with a center color and a linear falloff to a single color on both ends.
Parameters:
Parameter | Type | Description |
---|---|---|
focus | float | 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). |
setBlendTriangularShape(float focus, float scale)
public 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.
Parameters:
Parameter | Type | Description |
---|---|---|
focus | float | 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 | float | A value from 0 through 1 that specifies how fast the colors falloff from the starting color to focus (ending color) |
resetTransform()
public void resetTransform()
Resets the LinearGradientBrush.Transform
property to identity.
multiplyTransform(Matrix matrix)
public void multiplyTransform(Matrix matrix)
Multiplies the Matrix that represents the local geometric transform of this LinearGradientBrush by the specified Matrix by prepending the specified Matrix.
Parameters:
Parameter | Type | Description |
---|---|---|
matrix | Matrix | The Matrix by which to multiply the geometric transform. |
multiplyTransform(Matrix matrix, int order)
public void multiplyTransform(Matrix matrix, int order)
Multiplies the Matrix that represents the local geometric transform of this LinearGradientBrush by the specified Matrix in the specified order.
Parameters:
Parameter | Type | Description |
---|---|---|
matrix | Matrix | The Matrix by which to multiply the geometric transform. |
order | int | A MatrixOrder that specifies in which order to multiply the two matrices. |
translateTransform(float dx, float dy)
public void translateTransform(float dx, float dy)
Translates the local geometric transform by the specified dimensions. This method prepends the translation to the transform.
Parameters:
Parameter | Type | Description |
---|---|---|
dx | float | The value of the translation in x. |
dy | float | The value of the translation in y. |
translateTransform(float dx, float dy, int order)
public void translateTransform(float dx, float dy, int order)
Translates the local geometric transform by the specified dimensions in the specified order.
Parameters:
Parameter | Type | Description |
---|---|---|
dx | float | The value of the translation in x. |
dy | float | The value of the translation in y. |
order | int | The order (prepend or append) in which to apply the translation. |
scaleTransform(float sx, float sy)
public void scaleTransform(float sx, float sy)
Scales the local geometric transform by the specified amounts. This method prepends the scaling matrix to the transform.
Parameters:
Parameter | Type | Description |
---|---|---|
sx | float | The amount by which to scale the transform in the x-axis direction. |
sy | float | The amount by which to scale the transform in the y-axis direction. |
scaleTransform(float sx, float sy, int order)
public void scaleTransform(float sx, float sy, int order)
Scales the local geometric transform by the specified amounts in the specified order.
Parameters:
Parameter | Type | Description |
---|---|---|
sx | float | The amount by which to scale the transform in the x-axis direction. |
sy | float | The amount by which to scale the transform in the y-axis direction. |
order | int | A MatrixOrder that specifies whether to append or prepend the scaling matrix. |
rotateTransform(float angle)
public void rotateTransform(float angle)
Rotates the local geometric transform by the specified amount. This method prepends the rotation to the transform.
Parameters:
Parameter | Type | Description |
---|---|---|
angle | float | The angle of rotation. |
rotateTransform(float angle, int order)
public void rotateTransform(float angle, int order)
Rotates the local geometric transform by the specified amount in the specified order.
Parameters:
Parameter | Type | Description |
---|---|---|
angle | float | The angle of rotation. |
order | int | A MatrixOrder that specifies whether to append or prepend the rotation matrix. |