Skip to main content

Stretch Enum

Definition

Namespace:Avalonia.Media
Assembly:Avalonia.Base
Package:Avalonia

Describes how content is resized to fill its allocated space.

public enum Stretch

Inheritance: Enum -> Stretch

Fields

NameDescription
FillThe content is resized to fill the destination dimensions. The aspect ratio is not preserved.
NoneThe content preserves its original size.
UniformThe content is resized to fit in the destination dimensions while preserving its native aspect ratio.
UniformToFillThe content is resized to completely fill the destination rectangle while preserving its native aspect ratio. A portion of the content may not be visible if the aspect ratio of the content does not match the aspect ratio of the allocated space.

Fill Field

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

public Avalonia.Media.Stretch Fill

None Field

The content preserves its original size.

public Avalonia.Media.Stretch None

Uniform Field

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

public Avalonia.Media.Stretch Uniform

UniformToFill Field

The content is resized to completely fill the destination rectangle while preserving its native aspect ratio. A portion of the content may not be visible if the aspect ratio of the content does not match the aspect ratio of the allocated space.

public Avalonia.Media.Stretch UniformToFill