A VisualBrush can process a UI element and assign its pattern to the VisualBrush. It can then paint other areas of the screen with the pattern.
- [Narrator] The image brush is interesting.…It allows you to specify a part of the visual tree.…When WPF renders that part of the visual tree…it'll capture those pixels and that becomes…the brush that you use to paint other areas of the screen.…For this example my source visual will be this list box.…This list box has five rows and each row…has some text and has an image.…Here's what it looks like in my XAML.…Here's my list box, note that my list box…has a name, this will become important…when I work with my visual brush.…
Then inside the list box is a stack panel…that represents the first row,…and inside that stack panel is a text block and an image.…And then each of the additional rows…has an additional stack panel.…The point is this is a complex UI,…when I make this my visual source for my visual brush…whatever pixels are rendered from the child elements…also become part of my visual brush.…To create my visual brush I'll click on this rectangle,…currently it has a fill to the solid color brush,…and I'll change that.…
- Working with brushes
- Painting properties
- Painting in code
- Working with RGB channels
- Using hexadecimal values
- Setting opacity and transparency
- Editing color in the Visual Studio Color Editor
- Using gradient brushes
- Decorating with tiled brushes
- Adding brushes and colors to resources
- Working with opacity masks
Skill Level Intermediate
Windows Presentation Foundation: 2 Layoutwith Walt Ritscher2h 13m Intermediate
1. Brush and Color Overview
3. The Visual Studio Color Editor
4. The Gradient Brushes
5. The Tiled Brushes
6. Brushes and Colors in Resources
7. Opacity Mask
Examples of opacity patterns6m 47s
Next steps1m 11s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.