Mega Code Archive

 
Categories / C# / WPF
 

Paints a rectangle with an image The ImageBrushs Stretch property is set to None, so the image is not resized

<Window x:Class="Workspace.DockExample"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     Title="Workspace" Width="640" Height="480">       <Rectangle Width="50" Height="50">         <Rectangle.Fill>           <ImageBrush Stretch="None" TileMode="Tile"  ImageSource="c:\image.jpg"  />         </Rectangle.Fill>       </Rectangle> </Window>