LinearGradientBrush Class
A gradient along a line: the color is constant on the perpendiculars of that line.
public sealed class LinearGradientBrush : GradientBrushRemarks
The parameter of a position is its projection on the line from LinearGradientBrush.Start (0) to LinearGradientBrush.End (1). When both points are the same, the whole canvas has the color of the last stop.
- Inheritance
GradientBrushLinearGradientBrush
Constructors
| Name | Description |
|---|---|
| LinearGradientBrush(PointD, PointD, ReadOnlySpan<GradientStop>) | Initializes a new instance of the LinearGradientBrush class. |
LinearGradientBrush(PointD, PointD, ReadOnlySpan<GradientStop>)
LinearGradientBrush.csInitializes a new instance of the LinearGradientBrush class.
public LinearGradientBrush(PointD start, PointD end, ReadOnlySpan<GradientStop> stops)Parameters
startPointD- The position of offset 0, in canvas coordinates.
endPointD- The position of offset 1, in canvas coordinates.
stopsReadOnlySpan<GradientStop>- The stops, in increasing order of offset. They are copied.
Exceptions
ArgumentException- There is no stop, the offsets decrease, or a coordinate is not a finite number.
ArgumentOutOfRangeException- The magnitude of a coordinate exceeds 16777216.
Properties
| Name | Description |
|---|---|
| End | Gets the position of offset 1. |
| Start | Gets the position of offset 0. |