Table of Contents

Class PathGradientBrush

Namespace
Aspose.Imaging.Brushes
Assembly
Aspose.Imaging.dll

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

public sealed class PathGradientBrush : PathGradientBrushBase, IDisposable
Inheritance
PathGradientBrush
Implements
Inherited Members

Remarks

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

PathGradientBrush(GraphicsPath)

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

public PathGradientBrush(GraphicsPath path)

Parameters

path GraphicsPath

The GraphicsPath that defines the area filled by this PathGradientBrush.

PathGradientBrush(PointF[])

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

public PathGradientBrush(PointF[] pathPoints)

Parameters

pathPoints PointF[]

An array of PointF structures that represents the points that make up the vertices of the path.

PathGradientBrush(PointF[], WrapMode)

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

public PathGradientBrush(PointF[] pathPoints, WrapMode wrapMode)

Parameters

pathPoints PointF[]

An array of PointF structures that represents the points that make up the vertices of the path.

wrapMode WrapMode

A WrapMode that specifies how fills drawn with this PathGradientBrush are tiled.

PathGradientBrush(Point[])

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

public PathGradientBrush(Point[] pathPoints)

Parameters

pathPoints Point[]

An array of Point structures that represents the points that make up the vertices of the path.

PathGradientBrush(Point[], WrapMode)

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

public PathGradientBrush(Point[] pathPoints, WrapMode wrapMode)

Parameters

pathPoints Point[]

An array of Point structures that represents the points that make up the vertices of the path.

wrapMode WrapMode

A WrapMode that specifies how fills drawn with this PathGradientBrush are tiled.

Properties

Blend

Gets or sets a Blend that specifies positions and factors that define a custom falloff for the gradient.

public Blend Blend { get; set; }

Property Value

Blend

A Blend that represents a custom falloff for the gradient.

CenterColor

Gets or sets the color at the center of the path gradient.

public Color CenterColor { get; set; }

Property Value

Color

A Color that represents the color at the center of the path gradient.

InterpolationColors

Gets or sets a ColorBlend that defines a multicolor linear gradient.

[Obsolete("This property is not used in this class anymore. Use PathMulticolorGradientBrush class instead.")]
public ColorBlend InterpolationColors { get; set; }

Property Value

ColorBlend

A ColorBlend that defines a multicolor linear gradient.

SurroundColors

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

public Color[] SurroundColors { get; set; }

Property Value

Color[]

An array of Color structures that represents the colors associated with each point in the path this PathGradientBrush fills.

Methods

SetBlendTriangularShape(float)

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

public void SetBlendTriangularShape(float focus)

Parameters

focus float

A 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, float)

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

public void SetBlendTriangularShape(float focus, float scale)

Parameters

focus float

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

scale float

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

SetSigmaBellShape(float)

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.

public void SetSigmaBellShape(float focus)

Parameters

focus float

A 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, float)

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.

public void SetSigmaBellShape(float focus, float scale)

Parameters

focus float

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

scale float

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