Edit

Share via


ScreenUnitHelper.Convert Method

Definition

Overloads

Convert(ScreenUnit, ScreenUnit, Single)

Converts a screen unit to another screen unit (ex: 1cm => 37.7953px).

Convert(ScreenUnit, ScreenUnit, Single, XamlRoot)

Converts a screen unit to another screen unit (ex: 1cm => 37.7953px).

Convert(ScreenUnit, ScreenUnit, Single)

Converts a screen unit to another screen unit (ex: 1cm => 37.7953px).

public static float Convert (Microsoft.Toolkit.Uwp.Helpers.ScreenUnit from, Microsoft.Toolkit.Uwp.Helpers.ScreenUnit to, float value);
static member Convert : Microsoft.Toolkit.Uwp.Helpers.ScreenUnit * Microsoft.Toolkit.Uwp.Helpers.ScreenUnit * single -> single
Public Shared Function Convert (from As ScreenUnit, to As ScreenUnit, value As Single) As Single

Parameters

from
ScreenUnit

Start unit

to
ScreenUnit

End unit

value
Single

The value to convert (using start unit)

Returns

The result of the conversion

Applies to

Convert(ScreenUnit, ScreenUnit, Single, XamlRoot)

Converts a screen unit to another screen unit (ex: 1cm => 37.7953px).

public static float Convert (Microsoft.Toolkit.Uwp.Helpers.ScreenUnit from, Microsoft.Toolkit.Uwp.Helpers.ScreenUnit to, float value, Windows.UI.Xaml.XamlRoot xamlRoot = default);
static member Convert : Microsoft.Toolkit.Uwp.Helpers.ScreenUnit * Microsoft.Toolkit.Uwp.Helpers.ScreenUnit * single * Windows.UI.Xaml.XamlRoot -> single
Public Shared Function Convert (from As ScreenUnit, to As ScreenUnit, value As Single, Optional xamlRoot As XamlRoot = Nothing) As Single

Parameters

from
ScreenUnit

Start unit

to
ScreenUnit

End unit

value
Single

The value to convert (using start unit)

xamlRoot
Windows.UI.Xaml.XamlRoot

The XamlRoot that will be used to get the screen scale. Required on Xaml Islands.

Returns

The result of the conversion

Applies to