Share via


XRStretch (Compact 2013)

3/28/2014

This enumeration describes how content is resized to fill its allocated space.

Syntax

enum XRStretch{
    XRStretch_None=0,
    XRStretch_Fill=1,
    XRStretch_Uniform=2,
    XRStretch_UniformToFill=3,
};

Members

  • XRStretch_None
    The content preserves its original size.

    The following illustration shows an image with the Stretch property set to XRStretch_None.

    Ee501819.b25b2c91-1fea-4bc2-89e0-477a7426839b(en-us,WinEmbedded.80).jpg

  • XRStretch_Fill
    The content is resized to fill the destination dimensions. The aspect ratio is not preserved.

    The following illustration shows an image with the Stretch property set to XRStretch_Fill.

    Ee501819.6af348d1-f319-4c67-89d5-fd0f95ff1ffc(en-us,WinEmbedded.80).jpg

  • XRStretch_Uniform
    The content is resized to fit in the destination dimensions while preserving its native aspect ratio.

    The following illustration shows an image with the Stretch property set to XRStretch_Uniform.

    Ee501819.3b77c288-6a12-4180-83a4-59d2f7d0cabc(en-us,WinEmbedded.80).jpg

  • XRStretch_UniformToFill
    The content is resized to fill the destination dimensions while preserving its native aspect ratio. If the aspect ratio of the destination rectangle differs from the source, the source content is clipped to fit in the destination dimensions.

    The following illustration shows an image with the Stretch property set to XRStretch_UniformToFill.

    Ee501819.5cbcca5b-3022-49a0-b226-5215b1068ced(en-us,WinEmbedded.80).jpg

Remarks

In some cases you can get faster performance by setting Stretch properties to Fill instead of other values, including None. By using Fill, you eliminate potential clipping that can add extra edges. All types of stretch besides Fill need to compute layout. However, the difference in performance will probably be minimal unless you are rendering many images.

.NET Framework Equivalent

System.Windows.Media.Stretch

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

XAML for Windows Embedded Enumerations
IXRShape::GetStretch
IXRShape::SetStretch
IXRTileBrush::GetStretch
IXRTileBrush::SetStretch
IXRImage::GetStretch
IXRImage::SetStretch