Mega Code Archive

 
Categories / C# / WPF
 

Rectangle Fill with ImageBrush

<Page  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     x:Class="Microsoft.Samples.Graphics.UsingImageBrush.TilingExample" >   <Grid Margin="20">     <Rectangle       Grid.Row="3" Grid.Column="0"       Width="300" Height="150"       Stroke="MediumBlue" StrokeThickness="1"       HorizontalAlignment="Left">       <Rectangle.Fill>         <ImageBrush Stretch="None"  ImageSource="c:\image.jpg"  />       </Rectangle.Fill>     </Rectangle>   </Grid> </Page>