Stretch Property (ImageBrush)

Gets or sets a value that specifies how the content of this ImageBrush stretch to the applied brush area.

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

Property Value

Stretch

A value that specifies how the content is rendered.

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

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 AlignmentX and AlignmentY are at their defaults, this results in only the center area of the image 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 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

See Also

Silverlight Brushes Overview

Community Additions

Show: