[]
        
(Showing Draft Content)

C1.C1Preview.Unit.ConvertUnit

ConvertUnit Method

ConvertUnit(UnitTypeEnum)

Attempts to convert the current unit value to other unit of measurement.

Only absolute units can be converted. This method throws an exception if the conversion cannot be performed.

Declaration
public double ConvertUnit(UnitTypeEnum destUnitType)
Parameters
Type Name Description
UnitTypeEnum destUnitType

The target UnitTypeEnum.

Returns
Type Description
double

The value in destUnitType units.

ConvertUnit(UnitTypeEnum, float)

Attempts to convert the current unit value to other unit of measurement.

Only absolute units can be converted. This method throws an exception if the conversion cannot be performed.

Declaration
public double ConvertUnit(UnitTypeEnum destUnitType, float destDpi)
Parameters
Type Name Description
UnitTypeEnum destUnitType

The target UnitTypeEnum.

float destDpi

The target resolution (used if destUnitType is Pixel).

Returns
Type Description
double

The value in destUnitType units.

ConvertUnit(float, UnitTypeEnum, float)

Attempts to convert the current unit value to other unit of measurement.

Only absolute units can be converted. This method throws an exception if the conversion cannot be performed.

Declaration
public double ConvertUnit(float sourceDpi, UnitTypeEnum destUnitType, float destDpi)
Parameters
Type Name Description
float sourceDpi

The current unit value's resolution (used if Units is Pixel).

UnitTypeEnum destUnitType

The target UnitTypeEnum.

float destDpi

The target resolution (used if destUnitType is Pixel).

Returns
Type Description
double

The value in destUnitType units.