←Select platform

Convert Method (LogicalPoint)

Summary

Converts this LogicalPoint structure to the specified unit of measure.

Syntax

C#
VB
C++
public void Convert(  
   double sourceDpiX, 
   double sourceDpiY, 
   Leadtools.Forms.LogicalUnit destinationUnit, 
   double destinationDpiX, 
   double destinationDpiY 
) 
Public Sub Convert( _ 
   ByVal sourceDpiX As Double, _ 
   ByVal sourceDpiY As Double, _ 
   ByVal destinationUnit As Leadtools.Forms.LogicalUnit, _ 
   ByVal destinationDpiX As Double, _ 
   ByVal destinationDpiY As Double _ 
) 
public: 
void Convert(  
   double sourceDpiX, 
   double sourceDpiY, 
   Leadtools.Forms.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.

Remarks

The specified LogicalUnit is used to do the actual conversion.

Example

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

C#
VB
Imports Leadtools.Forms 
 
Public Sub LogicalPoint_LogicalPoint() 
   ' create a new logical point that is 1.5 and 2 inches 
   Dim pt As LogicalPoint = New LogicalPoint(1.5F, 2.0F, 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 
using Leadtools.Forms; 
 
public 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); 
} 

Requirements

Target Platforms

Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
Leadtools.Forms Assembly
Click or drag to resize