From the course: Windows Presentation Foundation 4: Brushes and Colors

Unlock the full course today

Join today to access over 22,400 courses taught by industry experts or purchase this course individually.

Set tiled properties using the TileBrush

Set tiled properties using the TileBrush

From the course: Windows Presentation Foundation 4: Brushes and Colors

Start my 1-month free trial

Set tiled properties using the TileBrush

- [Narrator] The Image Brush is considered to be a Tile Brush. By that I mean that it derives from this abstract base class, Tile Brush. And what I'll look at in this video is some of the properties that do the tiling of the image, where these other brushes. I'll be looking at these properties, Tile Mode, Viewbox and Viewport. All the examples I show in this video are for the Image Brush but everything I show you also applies to the Visual Brush and the Drawing Brush. I'll be modifying the grid on this window. Start by going to Properties and then Creating an Image Brush. As you can see, the image is filling the entire background of the grid. Over here in this drop down is the property called Tile mode, currently set to None. Changing these values doesn't seem to affect the picture. That's because you have to set the Viewport property. You don't see the Viewport here. What you'll need to do is select the Image Brush itself, then you'll see the Viewport property. So think of this as…

Contents