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
Constructor | Description |
---|---|
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
Method | Description |
---|---|
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:
Parameter | Type | Description |
---|---|---|
rect | RectangleF | The rectangle. |
color1 | Color | The color1. |
color2 | Color | The color2. |
angle | float | The angle. |
isAngleScalable | boolean | if 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:
Parameter | Type | Description |
---|---|---|
rect | Rectangle | The rectangle. |
color1 | Color | The color1. |
color2 | Color | The color2. |
angle | float | The angle. |
isAngleScalable | boolean | if 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:
Parameter | Type | Description |
---|---|---|
rect | RectangleF | The rectangle. |
color1 | Color | The color1. |
color2 | Color | The color2. |
angle | float | The 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:
Parameter | Type | Description |
---|---|---|
rect | Rectangle | The rectangle. |
color1 | Color | The color1. |
color2 | Color | The color2. |
angle | float | The 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:
Parameter | Type | Description |
---|---|---|
point1 | PointF | The point1. |
point2 | PointF | The point2. |
color1 | Color | The color1. |
color2 | Color | The 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:
Parameter | Type | Description |
---|---|---|
point1 | Point | The point1. |
point2 | Point | The point2. |
color1 | Color | The color1. |
color2 | Color | The 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:
Parameter | Type | Description |
---|---|---|
value | ColorBlend | A 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:
Parameter | Type | Description |
---|---|---|
value | Color[] | 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:
Parameter | Type | Description |
---|---|---|
value | Color | The 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:
Parameter | Type | Description |
---|---|---|
value | Color | The 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:
Parameter | Type | Description |
---|---|---|
value | Blend | A 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:
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 through1 that specifies how fast the colors falloff from the starting color to focus (ending color) |