Leadtools.Annotations Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
Convert(Single,AnnUnit,AnnUnit) Method
See Also  Example
Leadtools.Annotations Namespace > AnnUnitConverter Class > Convert Method : Convert(Single,AnnUnit,AnnUnit) Method



value
Value to be converted. This is in srcUnit units.
srcUnit
Source AnnUnit unit.
destUnit
Destination AnnUnit unit.
value
Value to be converted. This is in srcUnit units.
srcUnit
Source AnnUnit unit.
destUnit
Destination AnnUnit unit.
Converts a value from one unit to another.

Syntax

Visual Basic (Declaration) 
Overloads Public Shared Function Convert( _
   ByVal value As Single, _
   ByVal srcUnit As AnnUnit, _
   ByVal destUnit As AnnUnit _
) As Single
Visual Basic (Usage)Copy Code
Dim value As Single
Dim srcUnit As AnnUnit
Dim destUnit As AnnUnit
Dim value As Single
 
value = AnnUnitConverter.Convert(value, srcUnit, destUnit)
C# 
public static float Convert( 
   float value,
   AnnUnit srcUnit,
   AnnUnit destUnit
)
C++/CLI 
public:
static float Convert( 
   float value,
   AnnUnit srcUnit,
   AnnUnit destUnit
) 

Parameters

value
Value to be converted. This is in srcUnit units.
srcUnit
Source AnnUnit unit.
destUnit
Destination AnnUnit unit.

Return Value

The converted value.

Example

This example converts a value of 200 pixels to inches at 96 DPI.

Visual BasicCopy Code
Public Sub AnnUnitConverter_Convert()
   Dim result As Single = AnnUnitConverter.Convert(200.0F, AnnUnit.Pixel, AnnUnit.Inch)
End Sub
C#Copy Code
public void AnnUnitConverter_Convert() 

   float result = AnnUnitConverter.Convert(200.0F, AnnUnit.Pixel, AnnUnit.Inch); 
}

Remarks

This method uses the default DPI value of 96.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also

Leadtools.Annotations requires a Document or Medical toolkit license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features