LEADTOOLS Forms (Leadtools.Forms assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
Convert Method
See Also 
Leadtools.Forms Namespace > LogicalPoint Structure : Convert Method



sourceDpiX
Represents the DPI of the source value along the x-axis. This value is only used if the source unit of measure is Leadtools.Forms.LogicalUnit.Pixel.
sourceDpiY
Represents the DPI of the source value along the y-axis. This value is only used if the source unit of measure is Leadtools.Forms.LogicalUnit.Pixel.
destinationUnit
The unit of measurement of the destination value.
destinationDpiX
Represents the DPI of the destination value along the x-axis. This value is only used if the source unit of measure is Leadtools.Forms.LogicalUnit.Pixel.
destinationDpiY
Represents the DPI of the destination value along the y-axis. This value is only used if the source unit of measure is Leadtools.Forms.LogicalUnit.Pixel.

The Convert Method is available as an add-on to the LEADTOOLS Document and Medical Imaging toolkits.

sourceDpiX
Represents the DPI of the source value along the x-axis. This value is only used if the source unit of measure is Leadtools.Forms.LogicalUnit.Pixel.
sourceDpiY
Represents the DPI of the source value along the y-axis. This value is only used if the source unit of measure is Leadtools.Forms.LogicalUnit.Pixel.
destinationUnit
The unit of measurement of the destination value.
destinationDpiX
Represents the DPI of the destination value along the x-axis. This value is only used if the source unit of measure is Leadtools.Forms.LogicalUnit.Pixel.
destinationDpiY
Represents the DPI of the destination value along the y-axis. This value is only used if the source unit of measure is Leadtools.Forms.LogicalUnit.Pixel.
Converts this LogicalPoint structure to the specified unit of measure.

Syntax

Visual Basic (Declaration) 
Public Sub Convert( _
   ByVal sourceDpiX As Double, _
   ByVal sourceDpiY As Double, _
   ByVal destinationUnit As LogicalUnit, _
   ByVal destinationDpiX As Double, _
   ByVal destinationDpiY As Double _
) 
Visual Basic (Usage)Copy Code
Dim instance As LogicalPoint
Dim sourceDpiX As Double
Dim sourceDpiY As Double
Dim destinationUnit As LogicalUnit
Dim destinationDpiX As Double
Dim destinationDpiY As Double
 
instance.Convert(sourceDpiX, sourceDpiY, destinationUnit, destinationDpiX, destinationDpiY)
C# 
public void Convert( 
   double sourceDpiX,
   double sourceDpiY,
   LogicalUnit destinationUnit,
   double destinationDpiX,
   double destinationDpiY
)
C++/CLI 
public:
void Convert( 
   double sourceDpiX,
   double sourceDpiY,
   LogicalUnit destinationUnit,
   double destinationDpiX,
   double destinationDpiY
) 

Parameters

sourceDpiX
Represents the DPI of the source value along the x-axis. This value is only used if the source unit of measure is Leadtools.Forms.LogicalUnit.Pixel.
sourceDpiY
Represents the DPI of the source value along the y-axis. This value is only used if the source unit of measure is Leadtools.Forms.LogicalUnit.Pixel.
destinationUnit
The unit of measurement of the destination value.
destinationDpiX
Represents the DPI of the destination value along the x-axis. This value is only used if the source unit of measure is Leadtools.Forms.LogicalUnit.Pixel.
destinationDpiY
Represents the DPI of the destination value along the y-axis. This value is only used if the source unit of measure is Leadtools.Forms.LogicalUnit.Pixel.

Example

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

Visual BasicCopy Code
Private Sub LogicalPoint_LogicalPoint()
   ' create a new logical point that is 1.5 and 2 inches
   Dim pt As LogicalPoint = New LogicalPoint(1.5f, 2f, LogicalUnit.Inch)
   ' show the point
   Dim s As String = String.Format("{0}", pt)
   MessageBox.Show(s)

   ' convert the point to pixels
   pt.Convert(150, 150, LogicalUnit.Pixel, 150, 150)

   ' show
   s = String.Format("{0}", pt)
   MessageBox.Show(s)
End Sub
C#Copy Code
private void LogicalPoint_LogicalPoint()
{
   // create a new logical point that is 1.5 and 2 inches
   LogicalPoint pt = new LogicalPoint(1.5f, 2f, LogicalUnit.Inch);
   // show the point
   string s = string.Format("{0}", pt);
   MessageBox.Show(s);

   // convert the point to pixels
   pt.Convert(150, 150, LogicalUnit.Pixel, 150, 150);

   // show
   s = string.Format("{0}", pt);
   MessageBox.Show(s);
}

Remarks

The specified LogicalUnit is used to do the actual conversion.

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also

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