The derived classes of TileBrush define the contents of the tiles that you use to paint a region. For example, use the ImageBrush class to paint an area by using an image.
Use a TileBrush to control how you paint an area. For example, Windows Presentation Foundation (WPF) provides several types of brushes:
When you use the TileBrush to paint an area, instead of painting an area by using a single stretched image, you can paint an area by using a series of image tiles that create a pattern.
When you paint an area by using a TileBrush, you use three components: content, tiles, and the output area. The following illustrations show how these three TileBrush components relate to each other.
Components of a TileBrush with a single tile
.png)
Components of a TileBrush with a TileMode of Tile
.png)
Content: A TileBrush can have different types of content:
You can specify the position and dimensions of TileBrush content by using the Viewbox property.
Tiles: A TileBrush produces one or more tiles. By default, the content of the brush is stretched to fill a single tile and that tile is stretched to fill the output area. The Viewport property is used to specify the size and position of the base tile for the TileBrush. The ViewportUnits property determines whether the size and position of the Viewport are relative to the output area (the default behavior) or whether they are absolute values.
Output Area: The output area is the area that the brush paints, such as the Fill of an Ellipse or the Background of a Button.
For more information about the TileBrush class, see Painting with Images, Drawings, and Visuals .
Freezable Features
Notes to Inheritors:
When you inherit from the TileBrush class, you must override the CreateInstanceCore method. For more information about inheriting from Freezable types, see the Freezable Objects Overview.