Stretch property

Image.Stretch property

Gets or sets a value that describes how an Image should be stretched to fill the destination rectangle.


public Stretch Stretch { get; set; }

<Image Stretch="stretchValue"/>

XAML Values


A named constant of the Stretch enumeration, such as Uniform.

Property value

Type: Stretch

A value of the Stretch enumeration that specifies how the source image is rendered, if the Height and/or Width of the Image are not explicitly specified. The default value is Uniform.


The value of the Stretch property is only relevant if the Image instance is not already using explicitly set values for the Height and/or Width property, and if the Image instance is inside a container that can stretch the image to fill some available space in layout. If you set the value of the Stretch property to None, the image always retains its natural size, even if there's a layout container that might stretch it otherwise. For more info on image sizing, see Remarks in Image.

Image sources and scaling

You should create your image sources at several recommended sizes, to ensure that your app looks great when Windows 8 scales it because of device scaling and resolution. This is often a better way to handling image resizing rather than applying a nondefault Stretch value. When specifying a Source for an Image, you can use a naming convention that will automatically reference the correct resource for the current scaling. For specifics of the naming convention and more info, see Quickstart: Using file or image resources.

For more info on how to design for scaling, see UX guidelines for layout and scaling.

Note  A Stretch value of None doesn't work for image resources that are intended to support scaling. The scaling will be detected and the appropriate scaled resource is loaded before the layout decisions implied by the None value are applied.

Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


Windows::UI::Xaml::Controls [C++]



Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]


Windows::UI::Xaml::Controls [C++]



See also




© 2016 Microsoft