Leadtools.Forms Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
Convert Method
See Also  Example
Leadtools.Forms Namespace > LogicalLength Structure : Convert Method



sourceDpi
Represents the DPI of the source value along the length direction. This value is only used if the source unit of measure is .Pixel.
destinationUnit
The unit of measurement of the destination value.
destinationDpi
Represents the DPI of the destination value along the length direction. This value is only used if the source unit of measure is .Pixel.
sourceDpi
Represents the DPI of the source value along the length direction. This value is only used if the source unit of measure is .Pixel.
destinationUnit
The unit of measurement of the destination value.
destinationDpi
Represents the DPI of the destination value along the length direction. This value is only used if the source unit of measure is .Pixel.
Converts this LogicalLength structure to the specified unit of measure.

Syntax

Visual Basic (Declaration) 
Public Sub Convert( _
   ByVal sourceDpi As Double, _
   ByVal destinationUnit As LogicalUnit, _
   ByVal destinationDpi As Double _
) 
Visual Basic (Usage)Copy Code
Dim instance As LogicalLength
Dim sourceDpi As Double
Dim destinationUnit As LogicalUnit
Dim destinationDpi As Double
 
instance.Convert(sourceDpi, destinationUnit, destinationDpi)
C# 
public void Convert( 
   double sourceDpi,
   LogicalUnit destinationUnit,
   double destinationDpi
)
C++/CLI 
public:
void Convert( 
   double sourceDpi,
   LogicalUnit destinationUnit,
   double destinationDpi
) 

Parameters

sourceDpi
Represents the DPI of the source value along the length direction. This value is only used if the source unit of measure is .Pixel.
destinationUnit
The unit of measurement of the destination value.
destinationDpi
Represents the DPI of the destination value along the length direction. This value is only used if the source unit of measure is .Pixel.

Example

This example creates a new LogicalLength structure in inches then converts it to pixels.

Visual BasicCopy Code
Private Sub LogicalLength_LogicalLength()
   ' create a new logical length that is 1.5 inches
   Dim lng As LogicalLength = New LogicalLength(1.5f, LogicalUnit.Inch)
   ' show the length
   Dim s As String = String.Format("{0}", lng)
   MessageBox.Show(s)

   ' convert the length to pixels
   lng.Convert(150, LogicalUnit.Pixel, 150)

   ' show
   s = String.Format("{0}", lng)
   MessageBox.Show(s)
End Sub
C#Copy Code
private void LogicalLength_LogicalLength() 

   // create a new logical length that is 1.5 inches 
   LogicalLength lng = new LogicalLength(1.5f, LogicalUnit.Inch); 
   // show the length 
   string s = string.Format("{0}", lng); 
   MessageBox.Show(s); 
 
   // convert the length to pixels 
   lng.Convert(150, LogicalUnit.Pixel, 150); 
 
   // show 
   s = string.Format("{0}", lng); 
   MessageBox.Show(s); 
}

Remarks

The specified LogicalUnit is used to do the actual conversion.

Requirements

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

See Also

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