EllipseGradient Class
Represents an ellipse gradient.
public class EllipseGradient : Gradient, ICloneable
- Inheritance:
- object BackgroundFill Gradient object
- Implements:
- ICloneable
Constructors
EllipseGradient()
Initializes an instance of the class.
public EllipseGradient()
EllipseGradient(EllipseGradient)
Initializes an instance of the class.
protected EllipseGradient(EllipseGradient copyFrom)
| Parameter | Type | Description |
|---|---|---|
| copyFrom | EllipseGradient | An instance of EllipseGradient which will be copied to initialize the new instance. |
Remarks
This constructor used in support of Clone() for base classes to initialize their fields.
EllipseGradient(Color, Color)
Initializes an instance of the class.
public EllipseGradient(Color centerColor, Color outerColor)
| Parameter | Type | Description |
|---|---|---|
| centerColor | Color | The center color of the gradient. |
| outerColor | Color | The outer color of the gradient. |
EllipseGradient(Color, Color, Color)
Initializes an instance of the class.
public EllipseGradient(Color centerColor, Color outerColor, Color backColor)
| Parameter | Type | Description |
|---|---|---|
| centerColor | Color | The center color of the gradient. |
| outerColor | Color | The outer color of the gradient. |
| backColor | Color | The background color of the gradient. |
Properties
BackColor
The background color of the gradient.
BackColorAlpha
The background color alpha value.
CenterColor
The center color of the gradient.
CenterColorAlpha
The center color alpha value.
OuterColor
The outer color of the gradient.
OuterColorAlpha
The outer color alpha value.
Methods
Clone()
Creates an exact duplicate of the BackgroundFill object.
Draw(Graphics, Rectangle, Rectangle, Color, Color)
Fills an area with the gradient.
public static void Draw(Graphics g, Rectangle bounds, Rectangle gradientBounds, Color centerColor, Color outerColor)
| Parameter | Type | Description |
|---|---|---|
| g | Graphics | The |
| bounds | Rectangle | The bounds of the area to paint. |
| gradientBounds | Rectangle | The bounds of the gradient effect. |
| centerColor | Color | The center color of the gradient. |
| outerColor | Color | The outer color of the gradient. |
Draw(Graphics, Rectangle, Rectangle, Color, Color, Color)
Fills an area with the gradient.
public static void Draw(Graphics g, Rectangle bounds, Rectangle gradientBounds, Color centerColor, Color outerColor, Color backColor)
| Parameter | Type | Description |
|---|---|---|
| g | Graphics | The |
| bounds | Rectangle | The bounds of the area to paint. |
| gradientBounds | Rectangle | The bounds of the gradient effect. |
| centerColor | Color | The center color of the gradient. |
| outerColor | Color | The outer color of the gradient. |
| backColor | Color | The background color of the gradient. |
DrawScaled(Graphics, Rectangle, Rectangle, Sides, SizeF)
Fills an area with the background fill.
public override void DrawScaled(Graphics g, Rectangle bounds, Rectangle gradientBounds, Sides side, SizeF scaleFactor)
| Parameter | Type | Description |
|---|---|---|
| g | Graphics | The |
| bounds | Rectangle | The bounds of the area to paint. |
| gradientBounds | Rectangle | The |
| side | Sides | The side with which the background fill should be oriented. |
| scaleFactor | SizeF | The factor of the scale transform to be applied where Width is applied to the x-axis, and Height is applied to the y-axis. |
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 object to compare with the current object. |
Returns
- bool:
trueif the specified object is equal to the current object; otherwise,false.
GetBrush(Rectangle, Sides)
Returns a Brush that represents the background fill.
public override Brush GetBrush(Rectangle bounds, Sides side)
| Parameter | Type | Description |
|---|---|---|
| bounds | Rectangle | The bounds of the area to paint. |
| side | Sides | The side with which the background fill should be oriented. |
Returns
GetHashCode()
Serves as the default hash function.
ResetBackColor()
Resets the BackColor property to its default value.
public virtual void ResetBackColor()
ResetCenterColor()
Resets the CenterColor property to its default value.
public virtual void ResetCenterColor()
ResetOuterColor()
Resets the OuterColor property to its default value.
public virtual void ResetOuterColor()
ShouldSerializeBackColor()
Indicates whether the BackColor property should be persisted.
public virtual bool ShouldSerializeBackColor()
Returns
- bool:
trueif the property value has changed from its default; otherwise,false.
ShouldSerializeCenterColor()
Indicates whether the CenterColor property should be persisted.
public virtual bool ShouldSerializeCenterColor()
Returns
- bool:
trueif the property value has changed from its default; otherwise,false.
ShouldSerializeOuterColor()
Indicates whether the OuterColor property should be persisted.
public virtual bool ShouldSerializeOuterColor()
Returns
- bool:
trueif the property value has changed from its default; otherwise,false.
Inherited Members
- 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.OnPropertyChanged(EventArgs)
- BackgroundFill.PropertyChanged
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object, object)
- object.ReferenceEquals(object, object)