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 > LogicalRectangle 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 .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 .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 .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 .Pixel.
sourceDpiX
Represents the DPI of the source value along the x-axis. This value is only used if the source unit of measure is .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 .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 .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 .Pixel.
Returns this LogicalRectangle structure, converted to its equivalent in the specified destination 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 LogicalRectangle
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 .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 .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 .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 .Pixel.

Example

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

Visual BasicCopy Code
Private Sub LogicalRectangle_LogicalRectangle()
   ' create a new logical rectangle that is 1.5 2. 3, and 4 inches
   Dim rect As LogicalRectangle = New LogicalRectangle(1.5f, 2f, 3f, 4f, LogicalUnit.Inch)
   ' show the rectangle
   Dim s As String = String.Format("{0}", rect)
   MessageBox.Show(s)

   ' convert the rectangle to pixels
   rect.Convert(150, 150, LogicalUnit.Pixel, 150, 150)

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

   // create a new logical rectangle that is 1.5 2. 3, and 4 inches 
   LogicalRectangle rect = new LogicalRectangle(1.5f, 2f, 3f, 4f, LogicalUnit.Inch); 
   // show the rectangle 
   string s = string.Format("{0}", rect); 
   MessageBox.Show(s); 
 
   // convert the rectangle to pixels 
   rect.Convert(150, 150, LogicalUnit.Pixel, 150, 150); 
 
   // show 
   s = string.Format("{0}", rect); 
   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