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

In This Topic
    ConvertUnit(Unit,UnitTypeEnum) Method
    In This Topic
    Converts an absolute C1.C1Preview.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 C1.C1Preview.Unit value to convert (must be an absolute value).
    destUnitType
    The destination unit type (C1.C1Preview.UnitTypeEnum; cannot be C1.C1Preview.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 C1.C1Preview.UnitTypeEnum.Pixel. To convert to pixels, use C1.C1Preview.C1PrintDocument.ConvertUnit instead.

    See Also