LinearGradientBrush Constructor (RectangleF, Color, Color, LinearGradientMode)

 

Creates a new instance of the LinearGradientBrush based on a rectangle, starting and ending colors, and an orientation mode.

Namespace:   System.Drawing.Drawing2D
Assembly:  System.Drawing (in System.Drawing.dll)

public:
LinearGradientBrush(
	RectangleF rect,
	Color color1,
	Color color2,
	LinearGradientMode linearGradientMode
)

Parameters

rect
Type: System.Drawing::RectangleF

A RectangleF structure that specifies the bounds of the linear gradient.

color1
Type: System.Drawing::Color

A Color structure that represents the starting color for the gradient.

color2
Type: System.Drawing::Color

A Color structure that represents the ending color for the gradient.

linearGradientMode
Type: System.Drawing.Drawing2D::LinearGradientMode

A LinearGradientMode enumeration element that specifies the orientation of the gradient. The orientation determines the starting and ending points of the gradient. For example, LinearGradientMode.ForwardDiagonal specifies that the starting point is the upper-left corner of the rectangle and the ending point is the lower-right corner of the rectangle.

.NET Framework
Available since 1.1
Return to top
Show: