Class MediaExtensions
Provides extension methods for Avalonia media.
public static class MediaExtensions
- Inheritance
-
MediaExtensions
- Inherited Members
Methods
CalculateScaling(Stretch, Size, Size, StretchDirection)
Calculates scaling based on a Stretch value.
public static Vector CalculateScaling(this Stretch stretch, Size destinationSize, Size sourceSize, StretchDirection stretchDirection = StretchDirection.Both)
Parameters
stretch
StretchThe stretch mode.
destinationSize
SizeThe size of the destination viewport.
sourceSize
SizeThe size of the source.
stretchDirection
StretchDirectionThe stretch direction.
Returns
- Vector
A vector with the X and Y scaling factors.
CalculateSize(Stretch, Size, Size, StretchDirection)
Calculates a scaled size based on a Stretch value.
public static Size CalculateSize(this Stretch stretch, Size destinationSize, Size sourceSize, StretchDirection stretchDirection = StretchDirection.Both)
Parameters
stretch
StretchThe stretch mode.
destinationSize
SizeThe size of the destination viewport.
sourceSize
SizeThe size of the source.
stretchDirection
StretchDirectionThe stretch direction.
Returns
- Size
The size of the stretched source.