CalculateScaling Method
Calculates scaling based on a Stretch value.
Definition
Namespace: Avalonia.Media
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public static Vector CalculateScaling(
this Stretch stretch,
Size destinationSize,
Size sourceSize,
StretchDirection stretchDirection = StretchDirection.Both
)
<ExtensionAttribute>
Public Shared Function CalculateScaling (
stretch As Stretch,
destinationSize As Size,
sourceSize As Size,
Optional stretchDirection As StretchDirection = StretchDirection.Both
) As Vector
[<ExtensionAttribute>]
static member CalculateScaling :
stretch : Stretch *
destinationSize : Size *
sourceSize : Size *
?stretchDirection : StretchDirection
(* Defaults:
let _stretchDirection = defaultArg stretchDirection StretchDirection.Both
*)
-> Vector
Parameters
- Stretch
- The stretch mode.
- Size
- The size of the destination viewport.
- Size
- The size of the source.
- StretchDirection (Optional)
- The stretch direction.
Return Value
Vector
A vector with the X and Y scaling factors.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type Stretch. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).