Mega Code Archive

 
Categories / VB.Net Tutorial / WPF
 

The ImageBrushs content is vertically aligned with the top of the output area

<Window       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     x:Class="SDKSample.SampleViewer"     Title="Examples" >    <Canvas>      <Rectangle Grid.Row="5" Grid.Column="0" Width="200" Height="150"       Stroke="Maroon" StrokeThickness="1" HorizontalAlignment="Left">       <Rectangle.Fill>         <ImageBrush Stretch="None" AlignmentY="Top" ImageSource="c:\image.jpg" />       </Rectangle.Fill>     </Rectangle>    </Canvas>  </Window>