Mega Code Archive

 
Categories / C# / WPF
 

Proportional Tiles (no stretch)

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     x:Class="Microsoft.Samples.Graphics.RectangleExample"     WindowTitle="Example">   <Canvas>     <TextBlock Grid.Row="2" Margin="3">       Proportional Tiles<LineBreak></LineBreak>(no stretch)     </TextBlock>     <Rectangle Grid.Row="2" Grid.Column="1" Stroke="Black">       <Rectangle.Fill>         <ImageBrush ImageSource="c:\image.jpg" TileMode="Tile" Stretch="None"                     Viewport="0 0 0.2 0.2"></ImageBrush>       </Rectangle.Fill>     </Rectangle>   </Canvas> </Page>