LinearGradient Class
Represents a simple linear gradient.
public abstract class LinearGradient : Gradient, ICloneable
- Inheritance:
- object BackgroundFill Gradient object
- Implements:
- ICloneable
Constructors
LinearGradient()
Initializes a new instance of the LinearGradient
class.
protected LinearGradient()
Remarks
The default constructor initializes all fields to their default values.
LinearGradient(LinearGradient)
Initializes a new instance of the LinearGradient
class.
protected LinearGradient(LinearGradient copyFrom)
Parameter | Type | Description |
---|---|---|
copyFrom | LinearGradient | An instance of |
Remarks
This constructor used in support of Clone() for base classes to initialize their fields.
LinearGradient(Color, Color)
Initializes a new instance of the LinearGradient
class.
protected LinearGradient(Color startColor, Color endColor)
Parameter | Type | Description |
---|---|---|
startColor | Color | The start color of the gradient. |
endColor | Color | The end color of the gradient. |
LinearGradient(Color, Color, float)
Initializes a new instance of the LinearGradient
class.
protected LinearGradient(Color startColor, Color endColor, float angle)
Parameter | Type | Description |
---|---|---|
startColor | Color | The start color of the gradient. |
endColor | Color | The end color of the gradient. |
angle | float | The angle, measured in degrees clockwise from the x-axis, that defines the orientation of the gradient. |
LinearGradient(Color, Color, float, BackgroundFillRotationType)
Initializes a new instance of the LinearGradient
class.
protected LinearGradient(Color startColor, Color endColor, float angle, BackgroundFillRotationType rotationType)
Parameter | Type | Description |
---|---|---|
startColor | Color | The start color of the gradient. |
endColor | Color | The end color of the gradient. |
angle | float | The angle, measured in degrees clockwise from the x-axis, that defines the orientation of the gradient. |
rotationType | BackgroundFillRotationType | The type of rotation to perform when drawing the background fill for a side. |
Properties
Angle
Gets or sets the angle, measured in degrees clockwise from the x-axis, that defines the orientation of the gradient.
public float Angle { get; set; }
Property Value
- float:
The angle, measured in degrees clockwise from the x-axis, that defines the orientation of the gradient.
EndColor
Gets or sets the end color of the gradient.
EndColorAlpha
Gets or sets the end color alpha value.
RotationType
Gets or sets the type of rotation to perform when drawing the background fill for a side.
public BackgroundFillRotationType RotationType { get; set; }
Property Value
- BackgroundFillRotationType:
A BackgroundFillRotationType indicating the type of rotation to perform when drawing the background fill for a side.
Remarks
The default drawing side is Top.
StartColor
Gets or sets the start color of the gradient.
public Color StartColor { get; set; }
Property Value
StartColorAlpha
Gets or sets the start color alpha value.
Methods
Equals(object)
Determines whether the specified Object
is equal to the current Object
.
public override bool Equals(object obj)
Parameter | Type | Description |
---|---|---|
obj | object | The |
Returns
- bool:
true
if the specifiedObject
is equal to the currentObject
; otherwise,false
.
GetHashCode()
Returns a hash code for this object.
public override int GetHashCode()
Returns
- int:
An integer value that specifies a hash value for this object.
ResetAngle()
Resets the Angle property to its default value.
public virtual void ResetAngle()
ResetEndColor()
Resets the EndColor property to its default value.
public virtual void ResetEndColor()
ResetRotationType()
Resets the RotationType property to its default value.
public virtual void ResetRotationType()
ResetStartColor()
Resets the StartColor property to its default value.
public virtual void ResetStartColor()
ShouldSerializeAngle()
Indicates whether the Angle property should be persisted.
public virtual bool ShouldSerializeAngle()
Returns
- bool:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializeEndColor()
Indicates whether the EndColor property should be persisted.
public virtual bool ShouldSerializeEndColor()
Returns
- bool:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializeRotationType()
Indicates whether the RotationType property should be persisted.
public virtual bool ShouldSerializeRotationType()
Returns
- bool:
true
if the property value has changed from its default; otherwise,false
.
ShouldSerializeStartColor()
Indicates whether the StartColor property should be persisted.
public virtual bool ShouldSerializeStartColor()
Returns
- bool:
true
if the property value has changed from its default; otherwise,false
.
Inherited Members
- BackgroundFill.Clone()
- BackgroundFill.Draw(Graphics, Rectangle)
- BackgroundFill.Draw(Graphics, Rectangle, Rectangle)
- BackgroundFill.Draw(Graphics, Rectangle, Sides)
- BackgroundFill.Draw(Graphics, Rectangle, Rectangle, Sides)
- BackgroundFill.DrawScaled(Graphics, Rectangle, SizeF)
- BackgroundFill.DrawScaled(Graphics, Rectangle, Rectangle, SizeF)
- BackgroundFill.DrawScaled(Graphics, Rectangle, Sides, SizeF)
- BackgroundFill.DrawScaled(Graphics, Rectangle, Rectangle, Sides, SizeF)
- BackgroundFill.GetBrush(Rectangle, Sides)
- BackgroundFill.OnPropertyChanged(EventArgs)
- BackgroundFill.PropertyChanged
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object, object)
- object.ReferenceEquals(object, object)