Skip to content

ImageBrush class

A brush that fills a region by tiling an image.

The image is drawn into DestinationRect; outside that rect the image is repeated according to TileMode. SourceRect selects which part of the image is used as the tile (full image by default).

The brush only references Image; it does not own it. Keeping the image alive for at least as long as the brush is the caller’s responsibility.

public sealed class ImageBrush : Brush, IEquatable<ImageBrush>
name description
ImageBrush(…) Creates an image brush that tiles image to fill a region.
DestinationRect { get; } Gets the destination rectangle for one tile (in DIPs, local coordinates).
Image { get; } Gets the image that provides the tile.
Opacity { get; } Gets the overall opacity multiplier applied to the tile.
SourceRect { get; } Gets the region within Image to use as the tile (in DIPs, image coordinates).
TileMode { get; } Gets how the tile extends beyond DestinationRect.
Transform { get; } Gets an optional transform applied to the tile geometry before rendering, or null for no additional transform. SVG patternTransform maps here.
Equals(…)
override Equals(…)
override GetHashCode()