PathGradientBrush

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

public final class PathGradientBrush extends PathGradientBrushBase

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

The center color is white by default. A user can changed this value at any time later.

The surround colors array is initialized by single element containing white color by default. The surround colors may be changed later, however at least single element is required when setting up the surround colors.

See the Blend for more details about its initialization.

Constructors

ConstructorDescription
PathGradientBrush(PointF[] points)Initializes a new instance of the PathGradientBrush class with the specified points.
PathGradientBrush(PointF[] points, int wrapMode)Initializes a new instance of the PathGradientBrush class with the specified points and wrap mode.
PathGradientBrush(Point[] points)Initializes a new instance of the PathGradientBrush class with the specified points.
PathGradientBrush(Point[] points, int wrapMode)Initializes a new instance of the PathGradientBrush class with the specified points and wrap mode.
PathGradientBrush(GraphicsPath path)Initializes a new instance of the PathGradientBrush class with the specified path.

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.
getCenterColor()Gets the color at the center of the path gradient.
setCenterColor(Color value)Sets the color at the center of the path gradient.
getSurroundColors()Gets an array of colors that correspond to the points in the path this PathGradientBrush fills.
setSurroundColors(Color[] value)Sets an array of colors that correspond to the points in the path this PathGradientBrush fills.
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 brush that changes color starting from the center of the path outward to the path’s boundary.
setSigmaBellShape(float focus, float scale)Creates a gradient brush that changes color starting from the center of the path outward to the path’s boundary.
setBlendTriangularShape(float focus)Creates a gradient with a center color and a linear falloff to one surrounding color.
setBlendTriangularShape(float focus, float scale)Creates a gradient with a center color and a linear falloff to each surrounding color.

PathGradientBrush(PointF[] points)

public PathGradientBrush(PointF[] points)

Initializes a new instance of the PathGradientBrush class with the specified points.

Parameters:

ParameterTypeDescription
pointsPointF[]An array of Aspose.Imaging.PointF structures that represents the points that make up the vertices of the path.

PathGradientBrush(PointF[] points, int wrapMode)

public PathGradientBrush(PointF[] points, int wrapMode)

Initializes a new instance of the PathGradientBrush class with the specified points and wrap mode.

Parameters:

ParameterTypeDescription
pointsPointF[]An array of Aspose.Imaging.PointF structures that represents the points that make up the vertices of the path.
wrapModeintA Aspose.Imaging.WrapMode that specifies how fills drawn with this PathGradientBrush are tiled.

PathGradientBrush(Point[] points)

public PathGradientBrush(Point[] points)

Initializes a new instance of the PathGradientBrush class with the specified points.

Parameters:

ParameterTypeDescription
pointsPoint[]An array of Aspose.Imaging.Point structures that represents the points that make up the vertices of the path.

PathGradientBrush(Point[] points, int wrapMode)

public PathGradientBrush(Point[] points, int wrapMode)

Initializes a new instance of the PathGradientBrush class with the specified points and wrap mode.

Parameters:

ParameterTypeDescription
pointsPoint[]An array of Aspose.Imaging.Point structures that represents the points that make up the vertices of the path.
wrapModeintA Aspose.Imaging.WrapMode that specifies how fills drawn with this PathGradientBrush are tiled.

PathGradientBrush(GraphicsPath path)

public PathGradientBrush(GraphicsPath path)

Initializes a new instance of the PathGradientBrush class with the specified path.

Parameters:

ParameterTypeDescription
pathGraphicsPathThe GraphicsPath that defines the area filled by this PathGradientBrush.

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.

getCenterColor()

public Color getCenterColor()

Gets the color at the center of the path gradient.

Returns: Color - A com.aspose.imaging.Color that represents the color at the center of the path gradient.

setCenterColor(Color value)

public void setCenterColor(Color value)

Sets the color at the center of the path gradient.

Parameters:

ParameterTypeDescription
valueColorA com.aspose.imaging.Color that represents the color at the center of the path gradient.

getSurroundColors()

public Color[] getSurroundColors()

Gets an array of colors that correspond to the points in the path this PathGradientBrush fills.

Returns: com.aspose.imaging.Color[] - An array of com.aspose.imaging.Color structures that represents the colors associated with each point in the path this PathGradientBrush fills.

setSurroundColors(Color[] value)

public void setSurroundColors(Color[] value)

Sets an array of colors that correspond to the points in the path this PathGradientBrush fills.

Parameters:

ParameterTypeDescription
valueColor[]An array of com.aspose.imaging.Color structures that represents the colors associated with each point in the path this PathGradientBrush fills.

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 brush that changes color starting from the center of the path outward to the path’s boundary. The transition from one color to another is based on a bell-shaped curve.

Parameters:

ParameterTypeDescription
focusfloatA value from 0 through 1 that specifies where, along any radial from the center of the path to the path’s boundary, the center color will be at its highest intensity. A value of 1 (the default) places the highest intensity at the center of the path.

setSigmaBellShape(float focus, float scale)

public void setSigmaBellShape(float focus, float scale)

Creates a gradient brush that changes color starting from the center of the path outward to the path’s boundary. The transition from one color to another is based on a bell-shaped curve.

Parameters:

ParameterTypeDescription
focusfloatA value from 0 through 1 that specifies where, along any radial from the center of the path to the path’s boundary, the center color will be at its highest intensity. A value of 1 (the default) places the highest intensity at the center of the path.
scalefloatA value from 0 through 1 that specifies the maximum intensity of the center color that gets blended with the boundary color. A value of 1 causes the highest possible intensity of the center color, and it is the default value.

setBlendTriangularShape(float focus)

public void setBlendTriangularShape(float focus)

Creates a gradient with a center color and a linear falloff to one surrounding color.

Parameters:

ParameterTypeDescription
focusfloatA value from 0 through 1 that specifies where, along any radial from the center of the path to the path’s boundary, the center color will be at its highest intensity. A value of 1 (the default) places the highest intensity at the center of the path.

setBlendTriangularShape(float focus, float scale)

public void setBlendTriangularShape(float focus, float scale)

Creates a gradient with a center color and a linear falloff to each surrounding color.

Parameters:

ParameterTypeDescription
focusfloatA value from 0 through 1 that specifies where, along any radial from the center of the path to the path’s boundary, the center color will be at its highest intensity. A value of 1 (the default) places the highest intensity at the center of the path.
scalefloatA value from 0 through 1 that specifies the maximum intensity of the center color that gets blended with the boundary color. A value of 1 causes the highest possible intensity of the center color, and it is the default value.