Stretch Enumeration
Describes how content is resized to fill its allocated space.
Definition
Namespace: Avalonia.Media
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public enum Stretch
Public Enumeration Stretch
type Stretch
Members
| None | 0 | The content preserves its original size. |
| Fill | 1 | The content is resized to fill the destination dimensions. The aspect ratio is not preserved. |
| Uniform | 2 | The content is resized to fit in the destination dimensions while preserving its native aspect ratio. |
| UniformToFill | 3 | 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. |
Extension Methods
| CalculateScaling(Size, Size, StretchDirection) | Calculates scaling based on a Stretch value. (Defined by MediaExtensions) |
| CalculateSize(Size, Size, StretchDirection) | Calculates a scaled size based on a Stretch value. (Defined by MediaExtensions) |