Partager via


Stretch (ImageBrush)

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets a value that specifies how the content of an ImageBrush should be stretched to the applied brush area.

<object Stretch="Stretch"  .../>
value = object.Stretch
object.Stretch = value

Property Value

Type: Stretch

One of the enumeration values that specifies how the content is rendered.

This property is read/write. The default value is Fill.

Managed Equivalent

Stretch

Remarks

The Stretch property accepts the following values, which the Stretch enumeration defines:

  • None: The content does not stretch to fill the output dimensions, and the applied brush area will come from the matching sized area of the image. If the AlignmentX and AlignmentY properties are at their defaults, only the center area of the image will be applied to the brush.

  • Uniform: The content is scaled to fit the output dimensions. However, the aspect ratio of the content is preserved.

  • UniformToFill: The content is scaled so that it completely fills the output area, but it preserves its original aspect ratio.

  • Fill: The content is scaled to fit the output dimensions. Because the content's height and width are scaled independently, the original aspect ratio of the content might not be preserved. That is, the content might be distorted in order to completely fill the output area.

Applies To

ImageBrush