May 2010
Intermediate to advanced
1272 pages
61h 18m
English
ImageBrushYou can fill a visual element with an image file taking advantage of the ImageBrush brush. This object is useful even if you want to fill text with image textures. The following code snippet shows how to apply an ImageBrush as a button background and as the text foreground color:

In the previous code, the Avatar.jpg file is just a sample picture of me. I suppose you might prefer to replace my face with one of your favorite pictures!
The image is specified by assigning the ImageSource property with the image’s Uri. The previous code produces the result shown in Figure 33.4 (see the last row).
Figure 33.4 Applying an ...
Read now
Unlock full access