To set an image as background of WPF Browser page, we can set an image as the Background of the Page and Grid. The following code snippet sets the background of a Grid to an image.
Also we can set the opacity of the image.
<Page x:Class="WPF.PageBackgroundImage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Page Backround" Width="325" Height="208">
<Page.Background>
<ImageBrush ImageSource="Image/Water lilies.jpg" Opacity="0.2"/></Page.Background>
<Grid>
<TextBlock Margin="16,78,0,58">
Image are set in background of Page in WPF</TextBlock>
</Grid>
</Page>
Output
Comments
Post a Comment