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.

Decorate elements using the ImageBrush

Decorate elements using the ImageBrush

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

Start my 1-month free trial

Decorate elements using the ImageBrush

- Use an ImageBrush to paint an area of the screen with the pixels from an image. By default, the ImageBrush uses all the pixels in the image. The ImageBrush is a TileBrush. One of the benefits that a TileBrush gives you, is that you can zoom in and pull out a subset of those pixels. So I can grab a subset of the pixels in the image and paint with that. For this example I'll use all the pixels. I'll be painting with these two pictures in my project. They're both pictures of flowers. The items I'll be painting are these two polygons, this text block, this button, this DockPanel and a border that's around this DockPanel. I'll start by selecting my first polygon, and going to properties, opening the brush section of the property window, and then this shows you all of the properties of type Brush. I'll select Fill, and then I want to look for these buttons, for the ImageBrush. As you can see there is no ImageBrush, but there is a TileBrush so this is the one that you want. Click on…

Contents