Image.Stretch Property
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Gets or sets a value that describes how an Image should be stretched to fill the destination rectangle.
Assembly: System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.
<Image Stretch="stretchValue"/>
XAML Values
Property Value
Type: System.Windows.Media.StretchStretch
A value of the enumeration that specifies how the source image is applied if the Height and Width of the Image are specified and are different than the source image's height and width.
The default value is Uniform.
Dependency property identifier field: StretchProperty
A value of Fill will cause your image to stretch to completely fill the output area. When the output area and the image have different aspect ratios, the image is distorted by this stretching. To make an Image preserve the aspect ratio of the image, set this property to Uniform (the default) or UniformToFill. Alternatively, you can leave Height and Width of the Image unset, which will display the image source at its true resolution, although this results in loss of control over the element sizing in XAML.