VB.NET 1.1 Tutorial - GDI+ - LinearGradientBrushA LinearGradientBrush encapsulates a Brush object with a linear gradient. This class encapsulates both two-color gradients and custom multicolor gradients. All linear gradients are defined along a line specified either by the width of a rectangle or by two points. By default, a two-color linear gradient is an even horizontal linear blend from the starting color to the ending color along the specified line. The direction of the gradient is specified by the LinearGradientMode enumeration or the angle in the constructor. There are several different methods for creating a LinearGradientBrush object. The version I have used previously takes the following arguments: Public Sub New( _ ByVal rect As Rectangle, _ ByVal color1 As Color, _ ByVal color2 As Color, _ ByVal linearGradientMode As LinearGradientMode _ ) Where the Parameters are:
Note that the Rectangle that specifies the bounds of the linear gradient shoud be greater that the size of the object you wish to fill. ReferencesFor more information on the LinearGradientBrush class, visit MSDN at microsoft here. For more information on the LinearGradientMode constructor, visit MSDN at microsoft here. What Next?Return to the Tutorial Contents. |