LinearGradientBrush
System.Drawing.Drawing2D.LinearGradientBrush
Namespace: System.Drawing.Drawing2D
Assembly: System.Drawing.Managed (4.0.0.0)
Encapsulates a Brush with a linear gradient. This class cannot be inherited.
public class LinearGradientBrush : BrushPublic Class LinearGradientBrush
Inherits BrushConstructors
LinearGradientBrush(point1, point2, color1, color2)
Initializes a new instance of the LinearGradientBrush class with the specified points and colors.
LinearGradientBrush(point1, point2, color1, color2)
Initializes a new instance of the LinearGradientBrush class with the specified points and colors.
LinearGradientBrush(rect, color1, color2, linearGradientMode)
Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation mode.
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, 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.
LinearGradientBrush(rect, color1, color2, linearGradientMode)
Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and orientation.
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, 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.
LinearGradientBrush(rect, color1, color2, angle)
Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle.
angle
The angle, measured in degrees clockwise from the x-axis, of the gradient's orientation line.
LinearGradientBrush(rect, color1, color2, angle)
Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle.
angle
The angle, measured in degrees clockwise from the x-axis, of the gradient's orientation line.
LinearGradientBrush(rect, color1, color2, angle, isAngleScalable)
Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle.
angle
The angle, measured in degrees clockwise from the x-axis, of the gradient's orientation line.
isAngleScalable
Set to to specify that the angle is affected by the transform associated with this LinearGradientBrush; otherwise, .
LinearGradientBrush(rect, color1, color2, angle, isAngleScalable)
Initializes a new instance of the LinearGradientBrush class based on a rectangle, starting and ending colors, and an orientation angle.
angle
The angle, measured in degrees clockwise from the x-axis, of the gradient's orientation line.
isAngleScalable
Set to to specify that the angle is affected by the transform associated with this LinearGradientBrush; otherwise, .
Properties
Blend
Blend: Gets or sets a Blend that specifies positions and factors that define a custom falloff for the gradient.
GammaCorrection
Boolean: Gets or sets a value indicating whether gamma correction is enabled for this LinearGradientBrush.
InterpolationColors
ColorBlend: Gets or sets a ColorBlend that defines a multicolor linear gradient.
LinearColors
Color[]: Gets or sets the starting and ending colors of the gradient.
Rectangle
RectangleF: Gets a rectangular region that defines the starting and ending points of the gradient.
Transform
Matrix: Gets or sets a copy Matrix that defines a local geometric transform for this LinearGradientBrush.
WrapMode
WrapMode: Gets or sets a WrapMode enumeration that indicates the wrap mode for this LinearGradientBrush.
Methods
Clone()
Creates an exact copy of this LinearGradientBrush.
Returns: Object. The LinearGradientBrush this method creates, cast as an object.
MultiplyTransform(matrix)
Multiplies the Matrix that represents the local geometric transform of this LinearGradientBrush by the specified Matrix by prepending the specified Matrix.
MultiplyTransform(matrix, order)
Multiplies the Matrix that represents the local geometric transform of this LinearGradientBrush by the specified Matrix in the specified order.
ResetTransform()
Resets the Transform property to identity.
RotateTransform(angle)
Rotates the local geometric transform by the specified amount. This method prepends the rotation to the transform.
RotateTransform(angle, order)
Rotates the local geometric transform by the specified amount in the specified order.
ScaleTransform(sx, sy)
Scales the local geometric transform by the specified amounts. This method prepends the scaling matrix to the transform.
ScaleTransform(sx, sy, order)
Scales the local geometric transform by the specified amounts in the specified order.
SetBlendTriangularShape(focus)
Creates a linear gradient with a center color and a linear falloff to a single color on both ends.
focus
A value from 0 through 1 that specifies the center of the gradient (the point where the gradient is composed of only the ending color).
SetBlendTriangularShape(focus, scale)
Creates a linear gradient with a center color and a linear falloff to a single color on both ends.
SetSigmaBellShape(focus)
Creates a gradient falloff based on a bell-shaped curve.
focus
A value from 0 through 1 that specifies the center of the gradient (the point where the starting color and ending color are blended equally).
SetSigmaBellShape(focus, scale)
Creates a gradient falloff based on a bell-shaped curve.
TranslateTransform(dx, dy)
Translates the local geometric transformation of this TextureBrush object by the specified dimensions. This method prepends the translation to the transformation.
TranslateTransform(dx, dy, order)
Translates the local geometric transform by the specified dimensions in the specified order.
Last updated
Was this helpful?