In This Article

SolidColorBackgroundFill Class

Provides a class that draws a solid color background fill.

[TypeConverter(typeof(SolidColorBackgroundFillConverter))]
public class SolidColorBackgroundFill : BackgroundFill, ICloneable
Inheritance:
object BackgroundFill object
Implements:
ICloneable

Constructors

SolidColorBackgroundFill()

Initializes an instance of the class.

public SolidColorBackgroundFill()

SolidColorBackgroundFill(SolidColorBackgroundFill)

Initializes an instance of the class.

protected SolidColorBackgroundFill(SolidColorBackgroundFill copyFrom)
Parameter Type Description
copyFrom SolidColorBackgroundFill

An instance of SolidColorBackgroundFill which will be copied to initialize the new instance.

Remarks

This constructor used in support of Clone() for base classes to initialize their fields.

SolidColorBackgroundFill(Color)

Initializes an instance of the class.

public SolidColorBackgroundFill(Color color)
Parameter Type Description
color Color

The color of the background fill.

Properties

Color

The color of the background fill.

public Color Color { get; set; }

Property Value

Color

ColorAlpha

The color alpha value.

public byte ColorAlpha { get; set; }

Property Value

byte

Methods

Clone()

Creates an exact duplicate of the BackgroundFill object.

public override BackgroundFill Clone()

Returns

BackgroundFill

Draw(Graphics, Rectangle, Color)

Fills an area with the background fill.

public static void Draw(Graphics g, Rectangle bounds, Color color)
Parameter Type Description
g Graphics

The Graphics object used to paint.

bounds Rectangle

The bounds of the area to paint.

color Color

The color of the background fill.

Draw(Graphics, int, int, int, int, Color)

Fills an area with the background fill.

public static void Draw(Graphics g, int x, int y, int width, int height, Color color)
Parameter Type Description
g Graphics

The Graphics object used to paint.

x int

The x-coordinate of the upper-left corner of the area to paint.

y int

The y-coordinate of the upper-left corner of the area to paint.

width int

The width of the area to paint.

height int

The height of the area to paint.

color Color

The color of the background fill.

DrawScaled(Graphics, Rectangle, Rectangle, Sides, SizeF)

Fills an area with the background fill.

public override void DrawScaled(Graphics g, Rectangle bounds, Rectangle brushBounds, Sides side, SizeF scaleFactor)
Parameter Type Description
g Graphics

The Graphics object used to paint.

bounds Rectangle

The bounds of the area to paint.

brushBounds Rectangle

The reference bounds for the brush.

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:

true if 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

Brush

GetHashCode()

Serves as the default hash function.

public override int GetHashCode()

Returns

int:

A hash code for the current object.

ResetColor()

Resets the Color property to its default value.

public virtual void ResetColor()

ShouldSerializeColor()

Indicates whether the Color property should be persisted.

public virtual bool ShouldSerializeColor()

Returns

bool:

true if the property value has changed from its default; otherwise, false.

Inherited Members

Extension Methods