In This Article

ImageBackgroundFill Class

Provides a class that draws an image as a background fill.

public class ImageBackgroundFill : BackgroundFill, ICloneable
Inheritance:
object BackgroundFill object
Implements:
ICloneable

Constructors

ImageBackgroundFill()

Initializes an instance of the class.

public ImageBackgroundFill()

ImageBackgroundFill(ImageBackgroundFill)

Initializes an instance of the class.

protected ImageBackgroundFill(ImageBackgroundFill copyFrom)
Parameter Type Description
copyFrom ImageBackgroundFill

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

Remarks

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

ImageBackgroundFill(Image?)

Initializes an instance of the class.

public ImageBackgroundFill(Image? image)
Parameter Type Description
image Image

The image to tile in the background.

ImageBackgroundFill(Image?, ImageBackgroundFillStyle)

Initializes an instance of the class.

public ImageBackgroundFill(Image? image, ImageBackgroundFillStyle style)
Parameter Type Description
image Image

The image to tile in the background.

style ImageBackgroundFillStyle

The style of the image.

Properties

Image

The image to tile in the background.

public Image? Image { get; set; }

Property Value

Image

Style

The style of the image.

public ImageBackgroundFillStyle Style { get; set; }

Property Value

ImageBackgroundFillStyle

Methods

Clone()

Creates an exact duplicate of the BackgroundFill object.

public override BackgroundFill Clone()

Returns

BackgroundFill

Draw(Graphics, Rectangle, Rectangle, Image)

Fills an area with the background fill.

public static void Draw(Graphics g, Rectangle bounds, Rectangle brushBounds, Image image)
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.

image Image

The image to tile in the background.

Draw(Graphics, Rectangle, Rectangle, Image, ImageBackgroundFillStyle)

Fills an area with the background fill.

public static void Draw(Graphics g, Rectangle bounds, Rectangle brushBounds, Image image, ImageBackgroundFillStyle style)
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.

image Image

The image to tile in the background.

style ImageBackgroundFillStyle

The style of the image.

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.

DrawScaled(Graphics, Rectangle, Rectangle, Image?, ImageBackgroundFillStyle, SizeF)

Fills an area with the background fill.

public static void DrawScaled(Graphics g, Rectangle bounds, Rectangle brushBounds, Image? image, ImageBackgroundFillStyle style, 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.

image Image

The image to tile in the background.

style ImageBackgroundFillStyle

The style of the image.

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.

DrawScaled(Graphics, Rectangle, Rectangle, Image, SizeF)

Fills an area with the background fill.

public static void DrawScaled(Graphics g, Rectangle bounds, Rectangle brushBounds, Image image, 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.

image Image

The image to tile in the background.

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.

ResetImage()

Resets the Image property to its default value.

public virtual void ResetImage()

ResetStyle()

Resets the Style property to its default value.

public virtual void ResetStyle()

ShouldSerializeImage()

Indicates whether the Image property should be persisted.

public virtual bool ShouldSerializeImage()

Returns

bool:

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

ShouldSerializeStyle()

Indicates whether the Style property should be persisted.

public virtual bool ShouldSerializeStyle()

Returns

bool:

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

Inherited Members

Extension Methods