MediaExtensions.

CalculateScaling(Stretch, Size, Size, StretchDirection) Method

Summary

Calculates scaling based on a Stretch value.
Namespace
Avalonia.Media
Containing Type
MediaExtensions

Syntax

public static Vector CalculateScaling(this Stretch stretch, Size destinationSize, Size sourceSize, StretchDirection stretchDirection = Both)

Parameters

Name Type Description
stretch Stretch The stretch mode.
destinationSize Size The size of the destination viewport.
sourceSize Size The size of the source.
stretchDirection StretchDirection The stretch direction.

Return Value

Type Description
Vector A vector with the X and Y scaling factors.