LinearGradientBrush Constructors

Definition

Initializes a new instance of the LinearGradientBrush class.

Overloads

LinearGradientBrush()

Initializes a new instance of the LinearGradientBrush class.

LinearGradientBrush(GradientStopCollection)

Initializes a new instance of the LinearGradientBrush class that has the specified gradient stops.

LinearGradientBrush(GradientStopCollection, Double)

Initializes a new instance of the LinearGradientBrush class that has the specified GradientStopCollection and angle.

LinearGradientBrush(Color, Color, Double)

Initializes a new instance of the LinearGradientBrush class that has the specified start Color, end Color, and angle.

LinearGradientBrush(GradientStopCollection, Point, Point)

Initializes a new instance of the LinearGradientBrush class that has the specified gradient stops, StartPoint, and EndPoint.

LinearGradientBrush(Color, Color, Point, Point)

Initializes a new instance of the LinearGradientBrush class that has the specified start Color, end Color, StartPoint, and EndPoint.

Remarks

The MappingMode of the brush is initialized to RelativeToBoundingBox.

LinearGradientBrush()

Initializes a new instance of the LinearGradientBrush class.

C#
public LinearGradientBrush();

Remarks

The MappingMode of the brush is initialized to RelativeToBoundingBox.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

LinearGradientBrush(GradientStopCollection)

Initializes a new instance of the LinearGradientBrush class that has the specified gradient stops.

C#
public LinearGradientBrush(System.Windows.Media.GradientStopCollection gradientStopCollection);

Parameters

gradientStopCollection
GradientStopCollection

The GradientStops to set on this brush.

Remarks

The MappingMode of the brush is initialized to RelativeToBoundingBox.

See also

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

LinearGradientBrush(GradientStopCollection, Double)

Initializes a new instance of the LinearGradientBrush class that has the specified GradientStopCollection and angle.

C#
public LinearGradientBrush(System.Windows.Media.GradientStopCollection gradientStopCollection, double angle);

Parameters

gradientStopCollection
GradientStopCollection

The GradientStops to set on this brush.

angle
Double

A Double that represents the angle, in degrees, of the gradient. A value of 0.0 creates a horizontal gradient, and a value of 90.0 creates a vertical gradient.

Remarks

The MappingMode of the brush is initialized to RelativeToBoundingBox.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

LinearGradientBrush(Color, Color, Double)

Initializes a new instance of the LinearGradientBrush class that has the specified start Color, end Color, and angle.

C#
public LinearGradientBrush(System.Windows.Media.Color startColor, System.Windows.Media.Color endColor, double angle);

Parameters

startColor
Color

The Color at offset 0.0.

endColor
Color

The Color at offset 1.0.

angle
Double

A Double that represents the angle, in degrees, of the gradient. A value of 0.0 creates a horizontal gradient, and a value of 90.0 creates a vertical gradient.

Remarks

The MappingMode of the brush is initialized to RelativeToBoundingBox.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

LinearGradientBrush(GradientStopCollection, Point, Point)

Initializes a new instance of the LinearGradientBrush class that has the specified gradient stops, StartPoint, and EndPoint.

C#
public LinearGradientBrush(System.Windows.Media.GradientStopCollection gradientStopCollection, System.Windows.Point startPoint, System.Windows.Point endPoint);

Parameters

gradientStopCollection
GradientStopCollection

The GradientStops to set on this brush.

startPoint
Point

The StartPoint of the gradient.

endPoint
Point

The EndPoint of the gradient.

Remarks

The MappingMode of the brush is initialized to RelativeToBoundingBox.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

LinearGradientBrush(Color, Color, Point, Point)

Initializes a new instance of the LinearGradientBrush class that has the specified start Color, end Color, StartPoint, and EndPoint.

C#
public LinearGradientBrush(System.Windows.Media.Color startColor, System.Windows.Media.Color endColor, System.Windows.Point startPoint, System.Windows.Point endPoint);

Parameters

startColor
Color

The Color at offset 0.0.

endColor
Color

The Color at offset 1.0.

startPoint
Point

The StartPoint of the gradient.

endPoint
Point

The EndPoint of the gradient.

Remarks

The MappingMode of the brush is initialized to RelativeToBoundingBox.

Applies to

.NET Framework 4.8.1 and other versions
Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10