Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ImageBrush

Silverlight

Paints an area with an image.

<ImageBrush   .../>

You can use an ImageBrush object to create a decorative effect for text in your application. For example, the Foreground property of a TextBlock object can specify an ImageBrush.

If the ImageSource property is set to an invalid format, or it specifies a URI that cannot be resolved, the ImageFailed event is raised.

The following XAML example shows how to set the Foreground property to an ImageBrush object, the image of which is used as the fill for the TextBlock objects rendered text.

<!-- TextBlock with an image brush applied to the text. -->
<TextBlock
  Canvas.Top="120"
  FontFamily="Verdana"
  FontSize="72"
  FontStyle="Italic"
  FontWeight="Bold">
  SHRUBBERY
  <TextBlock.Foreground>
    <ImageBrush ImageSource="forest.jpg"/>
  </TextBlock.Foreground>
</TextBlock>

Community Additions

Show:
© 2015 Microsoft