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

ConstructorDescription
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

MethodDescription
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:

ParameterTypeDescription
point1PointFA PointF structure that represents the starting point of the linear gradient.
point2PointFA PointF structure that represents the endpoint of the linear gradient.
color1ColorA Color structure that represents the starting color of the linear gradient.
color2ColorA 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:

ParameterTypeDescription
point1PointA Point structure that represents the starting point of the linear gradient.
point2PointA Point structure that represents the endpoint of the linear gradient.
color1ColorA Color structure that represents the starting color of the linear gradient.
color2ColorA 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:

ParameterTypeDescription
rectRectangleFA RectangleF structure that specifies the bounds of the linear gradient.
color1ColorA Color structure that represents the starting color for the gradient.
color2ColorA Color structure that represents the ending color for the gradient.
linearGradientModeintA 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:

ParameterTypeDescription
rectRectangleA Rectangle(.getRectangle) structure that specifies the bounds of the linear gradient.
color1ColorA Color structure that represents the starting color for the gradient.
color2ColorA Color structure that represents the ending color for the gradient.
linearGradientModeintA 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:

ParameterTypeDescription
rectRectangleFA RectangleF structure that specifies the bounds of the linear gradient.
color1ColorA Color structure that represents the starting color for the gradient.
color2ColorA Color structure that represents the ending color for the gradient.
anglefloatThe 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:

ParameterTypeDescription
rectRectangleFA RectangleF structure that specifies the bounds of the linear gradient.
color1ColorA Color structure that represents the starting color for the gradient.
color2ColorA Color structure that represents the ending color for the gradient.
anglefloatThe angle, measured in degrees clockwise from the x-axis, of the gradient’s orientation line.
isAngleScaleablebooleanSet 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:

ParameterTypeDescription
rectRectangleA Rectangle(.getRectangle) structure that specifies the bounds of the linear gradient.
color1ColorA Color structure that represents the starting color for the gradient.
color2ColorA Color structure that represents the ending color for the gradient.
anglefloatThe 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:

ParameterTypeDescription
rectRectangleA Rectangle(.getRectangle) structure that specifies the bounds of the linear gradient.
color1ColorA Color structure that represents the starting color for the gradient.
color2ColorA Color structure that represents the ending color for the gradient.
anglefloatThe angle, measured in degrees clockwise from the x-axis, of the gradient’s orientation line.
isAngleScaleablebooleanSet 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:

ParameterTypeDescription
valueColor[]

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:

ParameterTypeDescription
valueboolean

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:

ParameterTypeDescription
valueBlend

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:

ParameterTypeDescription
valueColorBlend

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:

ParameterTypeDescription
valueint

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:

ParameterTypeDescription
valueMatrix

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:

ParameterTypeDescription
focusfloatA 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:

ParameterTypeDescription
focusfloatA value from 0 through 1 that specifies the center of the gradient (the point where the gradient is composed of only the ending color).
scalefloatA 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:

ParameterTypeDescription
focusfloatA 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:

ParameterTypeDescription
focusfloatA value from 0 through 1 that specifies the center of the gradient (the point where the gradient is composed of only the ending color).
scalefloatA 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:

ParameterTypeDescription
matrixMatrixThe 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:

ParameterTypeDescription
matrixMatrixThe Matrix by which to multiply the geometric transform.
orderintA 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:

ParameterTypeDescription
dxfloatThe value of the translation in x.
dyfloatThe 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:

ParameterTypeDescription
dxfloatThe value of the translation in x.
dyfloatThe value of the translation in y.
orderintThe 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:

ParameterTypeDescription
sxfloatThe amount by which to scale the transform in the x-axis direction.
syfloatThe 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:

ParameterTypeDescription
sxfloatThe amount by which to scale the transform in the x-axis direction.
syfloatThe amount by which to scale the transform in the y-axis direction.
orderintA 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:

ParameterTypeDescription
anglefloatThe 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:

ParameterTypeDescription
anglefloatThe angle of rotation.
orderintA MatrixOrder that specifies whether to append or prepend the rotation matrix.