PrintDocument for WinForms | ComponentOne
C1.PrintDocument.4.8 Assembly / C1.C1Preview Namespace / C1PrintDocument Class / ConvertUnit Method / ConvertUnit(Unit,UnitTypeEnum) Method
The source Unit value to convert (must be an absolute value).
The destination unit type (UnitTypeEnum; cannot be UnitTypeEnum.Pixel).

In This Topic
    ConvertUnit(Unit,UnitTypeEnum) Method
    In This Topic
    Converts an absolute Unit value to the specified measurement units (this overload cannot convert to pixels).
    Syntax
    'Declaration
     
    Public Overloads Function ConvertUnit( _
       ByVal source As Unit, _
       ByVal destUnitType As UnitTypeEnum _
    ) As Double
    public double ConvertUnit( 
       Unit source,
       UnitTypeEnum destUnitType
    )

    Parameters

    source
    The source Unit value to convert (must be an absolute value).
    destUnitType
    The destination unit type (UnitTypeEnum; cannot be UnitTypeEnum.Pixel).

    Return Value

    A double representing the source value expressed in destUnitType units.
    Remarks

    The source must be an absolute value, such as "5mm", "1.5in", "8" and so on. The source cannot be an expression (such as "prev.width" or "prev.height*2+2mm").

    The destination units cannot be UnitTypeEnum.Pixel. To convert to pixels, use ConvertUnit(Unit,UnitTypeEnum,Single) instead.

    See Also