Class EllipticGradientBrush
- Namespace
- SixLabors.ImageSharp.Drawing.Processing
- Assembly
- SixLabors.ImageSharp.Drawing.dll
Provides an implementation of a brush for painting elliptical gradients. The ellipse is defined by a center point, a point on the longest axis, and the ratio between the longest and shortest axes.
public sealed class EllipticGradientBrush : GradientBrush, IEquatable<Brush>
- Inheritance
-
EllipticGradientBrush
- Implements
- Inherited Members
Constructors
EllipticGradientBrush(PointF, PointF, float, GradientRepetitionMode, params ColorStop[])
Base class for Gradient brushes
public EllipticGradientBrush(PointF center, PointF referenceAxisEnd, float axisRatio, GradientRepetitionMode repetitionMode, params ColorStop[] colorStops)
Parameters
centerPointFThe center of the elliptical gradient and 0 for the color stops.
referenceAxisEndPointFThe end point of the reference axis of the ellipse.
axisRatiofloatThe ratio of the axis widths. The second axis is perpendicular to the reference axis and its length is the reference axis length multiplied by this factor.
repetitionModeGradientRepetitionModeDefines how the colors of the gradients are repeated.
colorStopsColorStop[]The color stops.
Properties
AxisRatio
Gets the ratio of the secondary axis to the primary axis.
public float AxisRatio { get; }
Property Value
Center
Gets the center of the ellipse.
public PointF Center { get; }
Property Value
ReferenceAxisEnd
Gets the end point of the reference axis.
public PointF ReferenceAxisEnd { get; }
Property Value
Methods
CreateRenderer<TPixel>(Configuration, GraphicsOptions, int, RectangleF)
Creates the prepared execution object for this brush.
public override BrushRenderer<TPixel> CreateRenderer<TPixel>(Configuration configuration, GraphicsOptions options, int canvasWidth, RectangleF region) where TPixel : unmanaged, IPixel<TPixel>
Parameters
configurationConfigurationThe configuration instance to use when performing operations.
optionsGraphicsOptionsThe graphic options.
canvasWidthintThe canvas width for the current render pass.
regionRectangleFThe region the brush will be applied to.
Returns
- BrushRenderer<TPixel>
The BrushRenderer<TPixel> for this brush.
Type Parameters
TPixelThe 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.
Transform(Matrix4x4)
Returns a new brush with its defining geometry transformed by the given matrix.
public override Brush Transform(Matrix4x4 matrix)
Parameters
matrixMatrix4x4The transformation matrix to apply.
Returns
- Brush
A transformed brush, or
thisif the brush has no spatial parameters.