Method Convert
Convert(double, UnitMode, UnitMode, double)
Converts a numeric value from one UnitMode to another.
public static double Convert(double value, UnitMode from, UnitMode to, double dpi = 96)
Parameters
valuedoubleThe value to convert.
fromUnitModeThe unit of
value.toUnitModeThe target unit for the result.
dpidoubleDots per inch used for pixel-based conversions. Defaults to 96 (LM-Kit view space). Ignored for conversions that do not involve pixels or DIP.
Returns
- double
The converted value expressed in the
tounit.
Exceptions
- ArgumentOutOfRangeException
Thrown if
dpiis not positive or an unknown unit is provided.