Class PathGradientBrush

Class PathGradientBrush

Namespace: Aspose.Imaging.Brushes
Assembly: Aspose.Imaging.dll (25.2.0)

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

[JsonObject(MemberSerialization.OptIn)]
public sealed class PathGradientBrush : PathGradientBrushBase, IDisposable

Inheritance

objectDisposableObjectBrushTransformBrushPathGradientBrushBasePathGradientBrush

Implements

IDisposable

Inherited Members

PathGradientBrushBase.PathPoints, PathGradientBrushBase.GraphicsPath, PathGradientBrushBase.CenterPoint, PathGradientBrushBase.FocusScales, TransformBrush.ResetTransform(), TransformBrush.MultiplyTransform(Matrix), TransformBrush.MultiplyTransform(Matrix, MatrixOrder), TransformBrush.TranslateTransform(float, float), TransformBrush.TranslateTransform(float, float, MatrixOrder), TransformBrush.ScaleTransform(float, float), TransformBrush.ScaleTransform(float, float, MatrixOrder), TransformBrush.RotateTransform(float), TransformBrush.RotateTransform(float, MatrixOrder), TransformBrush.WrapMode, TransformBrush.Transform, TransformBrush.IsTransformChanged, Brush.DeepClone(), Brush.Equals(object), Brush.GetHashCode(), Brush.Opacity, DisposableObject.Dispose(), DisposableObject.Disposed, object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

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 Aspose.Imaging.Brushes.PathGradientBrush.Blend for more details about its initialization.

Constructors

PathGradientBrush(PointF[])

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

public PathGradientBrush(PointF[] pathPoints)

Parameters

pathPoints PointF[]

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

PathGradientBrush(PointF[], WrapMode)

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

public PathGradientBrush(PointF[] pathPoints, WrapMode wrapMode)

Parameters

pathPoints PointF[]

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

wrapMode WrapMode

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

PathGradientBrush(Point[])

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

public PathGradientBrush(Point[] pathPoints)

Parameters

pathPoints Point[]

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

PathGradientBrush(Point[], WrapMode)

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

public PathGradientBrush(Point[] pathPoints, WrapMode wrapMode)

Parameters

pathPoints Point[]

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

wrapMode WrapMode

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

PathGradientBrush(GraphicsPath)

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

public PathGradientBrush(GraphicsPath path)

Parameters

path GraphicsPath

The Aspose.Imaging.GraphicsPath that defines the area filled by this Aspose.Imaging.Brushes.PathGradientBrush.

Properties

Blend

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

public Blend Blend { get; set; }

Property Value

Blend

CenterColor

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

public Color CenterColor { get; set; }

Property Value

Color

InterpolationColors

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

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

Property Value

ColorBlend

SurroundColors

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

public Color[] SurroundColors { get; set; }

Property Value

Color[]

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.