Table of Contents

Class LinearGradientBrush

Namespace
Ecng.Drawing
Assembly
Ecng.Drawing.dll

Represents a brush that paints a gradient between multiple colors.

public class LinearGradientBrush : Brush
Inheritance
LinearGradientBrush
Inherited Members
Extension Methods

Constructors

LinearGradientBrush(Color[], Rectangle)

Represents a brush that paints a gradient between multiple colors.

public LinearGradientBrush(Color[] linearColors, Rectangle rectangle)

Parameters

linearColors Color[]

An array of colors defining the gradient stops.

rectangle Rectangle

The rectangle that defines the bounds of the gradient.

LinearGradientBrush(Point, Point, Color, Color)

Initializes a new instance of the LinearGradientBrush class using two points and two colors.

public LinearGradientBrush(Point stop0, Point stop1, Color color0, Color color1)

Parameters

stop0 Point

The first point of the gradient.

stop1 Point

The second point of the gradient.

color0 Color

The color at the first point.

color1 Color

The color at the second point.

Properties

LinearColors

Gets the array of colors defining the gradient stops.

public Color[] LinearColors { get; }

Property Value

Color[]

Rectangle

Gets the rectangle that defines the bounds of the gradient.

public Rectangle Rectangle { get; }

Property Value

Rectangle