Mega Code Archive

 
Categories / C# / WPF
 

Stretch = Uniform

<Window x:Class="Chapter05.ImageBrushExample"   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   Title="Chapter05" Height="300" Width="300">       <StackPanel Margin="5" Grid.Column="0" Grid.Row="1">         <TextBlock Margin="5" Text="Stretch = Uniform" />         <Button Width="135" Height="100">           <Button.Background>             <ImageBrush ImageSource="c:\image.jpg" Stretch="Uniform" />           </Button.Background>         </Button>       </StackPanel> </Window>