LinearGradientBrush

Inheritance: java.lang.Object, com.aspose.imaging.DisposableObject, com.aspose.imaging.Brush, com.aspose.imaging.brushes.TransformBrush, com.aspose.imaging.brushes.LinearGradientBrushBase

public final class LinearGradientBrush extends LinearGradientBrushBase

Encapsulates a Aspose.Imaging.Brush with a linear gradient. This class cannot be inherited.

Constructors

ConstructorDescription
LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle, boolean isAngleScalable)Initializes a new instance of the LinearGradientBrush class.
LinearGradientBrush(Rectangle rect, Color color1, Color color2, float angle, boolean isAngleScalable)Initializes a new instance of the LinearGradientBrush class.
LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle)Initializes a new instance of the LinearGradientBrush class.
LinearGradientBrush(Rectangle rect, Color color1, Color color2, float angle)Initializes a new instance of the LinearGradientBrush class.
LinearGradientBrush(PointF point1, PointF point2, Color color1, Color color2)Initializes a new instance of the LinearGradientBrush class.
LinearGradientBrush(Point point1, Point point2, Color color1, Color color2)Initializes a new instance of the LinearGradientBrush class.
LinearGradientBrush()Initializes a new instance of the LinearGradientBrush class with default parameters.

Methods

MethodDescription
getInterpolationColors()Gets a com.aspose.imaging.ColorBlend that defines a multicolor linear gradient.
setInterpolationColors(ColorBlend value)Sets a com.aspose.imaging.ColorBlend that defines a multicolor linear gradient.
getLinearColors()Gets the starting and ending colors of the gradient.
setLinearColors(Color[] value)Sets the starting and ending colors of the gradient.
getStartColor()Gets the starting gradient color.
setStartColor(Color value)Sets the starting gradient color.
getEndColor()Gets the ending gradient color.
setEndColor(Color value)Sets the ending gradient color.
getBlend()Gets a Aspose.Imaging.Blend that specifies positions and factors that define a custom falloff for the gradient.
setBlend(Blend value)Sets a Aspose.Imaging.Blend that specifies positions and factors that define a custom falloff for the gradient.
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.

LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle, boolean isAngleScalable)

public LinearGradientBrush(RectangleF rect, Color color1, Color color2, float angle, boolean isAngleScalable)

Initializes a new instance of the LinearGradientBrush class.

Parameters:

ParameterTypeDescription
rectRectangleFThe rectangle.
color1ColorThe color1.
color2ColorThe color2.
anglefloatThe angle.
isAngleScalablebooleanif set to true [is angle scalable].

LinearGradientBrush(Rectangle rect, Color color1, Color color2, float angle, boolean isAngleScalable)

public LinearGradientBrush(Rectangle rect, Color color1, Color color2, float angle, boolean isAngleScalable)

Initializes a new instance of the LinearGradientBrush class.

Parameters:

ParameterTypeDescription
rectRectangleThe rectangle.
color1ColorThe color1.
color2ColorThe color2.
anglefloatThe angle.
isAngleScalablebooleanif set to true [is angle scalable].

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.

Parameters:

ParameterTypeDescription
rectRectangleFThe rectangle.
color1ColorThe color1.
color2ColorThe color2.
anglefloatThe angle.

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.

Parameters:

ParameterTypeDescription
rectRectangleThe rectangle.
color1ColorThe color1.
color2ColorThe color2.
anglefloatThe angle.

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.

Parameters:

ParameterTypeDescription
point1PointFThe point1.
point2PointFThe point2.
color1ColorThe color1.
color2ColorThe color2.

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.

Parameters:

ParameterTypeDescription
point1PointThe point1.
point2PointThe point2.
color1ColorThe color1.
color2ColorThe color2.

LinearGradientBrush()

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).

getInterpolationColors()

public ColorBlend getInterpolationColors()

Gets a com.aspose.imaging.ColorBlend that defines a multicolor linear gradient.

Returns: ColorBlend - A com.aspose.imaging.ColorBlend that defines a multicolor linear gradient.

setInterpolationColors(ColorBlend value)

public void setInterpolationColors(ColorBlend value)

Sets a com.aspose.imaging.ColorBlend that defines a multicolor linear gradient.

Parameters:

ParameterTypeDescription
valueColorBlendA com.aspose.imaging.ColorBlend that defines a multicolor linear gradient.

getLinearColors()

public Color[] getLinearColors()

Gets the starting and ending colors of the gradient.

Returns: com.aspose.imaging.Color[] - An array of two Color structures that represents the starting and ending colors of the gradient.

setLinearColors(Color[] value)

public void setLinearColors(Color[] value)

Sets the starting and ending colors of the gradient.

Parameters:

ParameterTypeDescription
valueColor[]An array of two Color structures that represents the starting and ending colors of the gradient.

getStartColor()

public Color getStartColor()

Gets the starting gradient color.

Returns: Color - The starting gradient color.

setStartColor(Color value)

public void setStartColor(Color value)

Sets the starting gradient color.

Parameters:

ParameterTypeDescription
valueColorThe starting gradient color.

getEndColor()

public Color getEndColor()

Gets the ending gradient color.

Returns: Color - The ending gradient color.

setEndColor(Color value)

public void setEndColor(Color value)

Sets the ending gradient color.

Parameters:

ParameterTypeDescription
valueColorThe ending gradient color.

getBlend()

public Blend getBlend()

Gets a Aspose.Imaging.Blend that specifies positions and factors that define a custom falloff for the gradient.

Returns: Blend - A Aspose.Imaging.Blend that represents a custom falloff for the gradient.

setBlend(Blend value)

public void setBlend(Blend value)

Sets a Aspose.Imaging.Blend that specifies positions and factors that define a custom falloff for the gradient.

Parameters:

ParameterTypeDescription
valueBlendA Aspose.Imaging.Blend that represents a custom falloff for the gradient.

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 through1 that specifies how fast the colors falloff from the starting color to focus (ending color)