The Convert(Single,AnnUnit,AnnUnit) Method is available in LEADTOOLS Document and Medical Imaging toolkits.
- value
- Value to be converted. This is in srcUnit units.
- srcUnit
- Source AnnUnit unit.
- destUnit
- Destination AnnUnit unit.
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) |
Parameters
- value
- Value to be converted. This is in srcUnit units.
- srcUnit
- Source AnnUnit unit.
- destUnit
- Destination AnnUnit unit.
Return Value
The converted value.This example converts a value of 200 pixels to inches at 96 DPI.
Visual Basic | Copy 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); } |
This method uses the default DPI value of 96.
Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7