Class PathGradientBrush
Provides an implementation of a brush for painting gradients between multiple color positions in 2D coordinates.
Implements
Inherited Members
Namespace: SixLabors.ImageSharp.Drawing.Processing
Assembly: SixLabors.ImageSharp.Drawing.dll
Syntax
public sealed class PathGradientBrush : IBrush
Constructors
| Improve this Doc View SourcePathGradientBrush(PointF[], Color[])
Initializes a new instance of the PathGradientBrush class.
Declaration
public PathGradientBrush(PointF[] points, Color[] colors)
Parameters
Type | Name | Description |
---|---|---|
PointF[] | points | Points that constitute a polygon that represents the gradient area. |
Color[] | colors | Array of colors that correspond to each point in the polygon. |
PathGradientBrush(PointF[], Color[], Color)
Initializes a new instance of the PathGradientBrush class.
Declaration
public PathGradientBrush(PointF[] points, Color[] colors, Color centerColor)
Parameters
Type | Name | Description |
---|---|---|
PointF[] | points | Points that constitute a polygon that represents the gradient area. |
Color[] | colors | Array of colors that correspond to each point in the polygon. |
Color | centerColor | Color at the center of the gradient area to which the other colors converge. |
Methods
| Improve this Doc View SourceCreateApplicator<TPixel>(Configuration, GraphicsOptions, ImageFrame<TPixel>, RectangleF)
Creates the applicator for this brush.
Declaration
public BrushApplicator<TPixel> CreateApplicator<TPixel>(Configuration configuration, GraphicsOptions options, ImageFrame<TPixel> source, RectangleF region)
where TPixel : struct, IPixel<TPixel>
Parameters
Type | Name | Description |
---|---|---|
Configuration | configuration | The configuration instance to use when performing operations. |
GraphicsOptions | options | The graphic options. |
ImageFrame<TPixel> | source | The source image. |
RectangleF | region | The region the brush will be applied to. |
Returns
Type | Description |
---|---|
BrushApplicator<TPixel> | The BrushApplicator<TPixel> for this brush. |
Type Parameters
Name | Description |
---|---|
TPixel | The pixel type. |
Remarks
The region
when being applied to things like shapes would usually be the
bounding box of the shape not necessarily the bounds of the whole image.