Table of Contents

Class MediaExtensions

Namespace
Avalonia.Media
Assembly
Avalonia.Base.dll

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 Stretch

The stretch mode.

destinationSize Size

The size of the destination viewport.

sourceSize Size

The size of the source.

stretchDirection StretchDirection

The 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 Stretch

The stretch mode.

destinationSize Size

The size of the destination viewport.

sourceSize Size

The size of the source.

stretchDirection StretchDirection

The stretch direction.

Returns

Size

The size of the stretched source.