[]
        
(Showing Draft Content)

GrapeCity.Documents.Common.Unit.Convert

Convert Method

Convert(UnitTypeEnum)

Converts value of this Unit structure to value in specified units of measurement.

Declaration
public float Convert(UnitTypeEnum to)
Parameters
Type Name Description
UnitTypeEnum to

The target unit of measurement.

Returns
Type Description
float

Returns the value in to units.

Convert(float, float, UnitTypeEnum)

Converts a value from pixel unit of measurement to another.

Declaration
public static float Convert(float value, float fromDpi, UnitTypeEnum to)
Parameters
Type Name Description
float value

The value to convert in pixels.

float fromDpi

The source dpi.

UnitTypeEnum to

The target unit of measurement.

Returns
Type Description
float

value converted to to units.

Convert(float, UnitTypeEnum, float)

Converts a value from one unit of measurement to pixel.

Declaration
public static float Convert(float value, UnitTypeEnum from, float toDpi)
Parameters
Type Name Description
float value

The value to convert in from units.

UnitTypeEnum from

The source unit of measurement.

float toDpi

The target dpi.

Returns
Type Description
float

value converted to pixels with specified dpi.

Convert(float, UnitTypeEnum, UnitTypeEnum)

Converts a value from one unit of measurement to another.

Declaration
public static float Convert(float value, UnitTypeEnum from, UnitTypeEnum to)
Parameters
Type Name Description
float value

The value to convert.

UnitTypeEnum from

The source unit of measurement.

UnitTypeEnum to

The target unit of measurement.

Returns
Type Description
float

value converted to to units.