Paints an area with an image.
| XAML | <ImageBrush .../> |
| Scripting | To create an object using scripting, see CreateFromXAML. |
Properties
AlignmentX,
AlignmentY,
DownloadProgress,
ImageSource,
Name,
Opacity,
RelativeTransform,
Stretch,
Transform
Methods
Equals,
FindName,
GetHost,
GetValue,
SetSource,
SetValue
Events
DownloadProgressChanged
Examples
The following XAML example shows how to set the Foreground property to an
ImageBrush, whose image is used as the fill for the TextBlock's rendered text.
| XAML |
<!-- 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>
|
The following screenshot shows the results of the previous XAML example.
An image file used by Image and ImageBrush objects
See Also
Imaging Overview
Brush Overview
Brush
Image