LEADTOOLS Forms (Leadtools.Forms assembly)

Show in webframe

ConvertTo Method (LogicalRectangle)






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.
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.
The unit of measurement of the destination value.
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.
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.
Returns this LogicalRectangle structure, converted to its equivalent in the specified destination unit of measure.
Syntax
'Declaration
 
Public Function ConvertTo( _
   ByVal sourceDpiX As Double, _
   ByVal sourceDpiY As Double, _
   ByVal destinationUnit As LogicalUnit, _
   ByVal destinationDpiX As Double, _
   ByVal destinationDpiY As Double _
) As LogicalRectangle
'Usage
 
Dim instance As LogicalRectangle
Dim sourceDpiX As Double
Dim sourceDpiY As Double
Dim destinationUnit As LogicalUnit
Dim destinationDpiX As Double
Dim destinationDpiY As Double
Dim value As LogicalRectangle
 
value = instance.ConvertTo(sourceDpiX, sourceDpiY, destinationUnit, destinationDpiX, 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 LogicalRectangle structure in inches then converts it to another LogicalRectangle structure in pixels.

Copy Code  
Imports Leadtools.Forms

<TestMethod> _
Public Sub LogicalRectangle_ConvertTo()
   ' create a new logical rectangle that is 1.5 2, 3, and 4 inches
   Dim rect1 As LogicalRectangle = New LogicalRectangle(1.5F, 2.0F, 3.0F, 4.0F, LogicalUnit.Inch)
   ' show the rectangle
   Dim s As String = String.Format("{0}", rect1)
   MessageBox.Show(s)

   ' convert the rectangle to pixels
   Dim rect2 As LogicalRectangle = rect1.ConvertTo(150, 150, LogicalUnit.Pixel, 150, 150)

   ' show
   s = String.Format("{0}", rect2)
   MessageBox.Show(s)
End Sub
using Leadtools.Forms;

public void LogicalRectangle_ConvertTo()
{
   // create a new logical rectangle that is 1.5 2, 3, and 4 inches
   LogicalRectangle rect1 = new LogicalRectangle(1.5f, 2f, 3f, 4f, LogicalUnit.Inch);
   // show the rectangle
   string s = string.Format("{0}", rect1);
   MessageBox.Show(s);

   // convert the rectangle to pixels
   LogicalRectangle rect2 = rect1.ConvertTo(150, 150, LogicalUnit.Pixel, 150, 150);

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

Target Platforms

See Also

Reference

LogicalRectangle Structure
LogicalRectangle Members

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