←Select platform

Convert Method (LogicalLength)

Summary

Converts this LogicalLength structure to the specified unit of measure.

Syntax

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

Remarks

The specified LogicalUnit is used to do the actual conversion.

Example

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

C#
VB
Imports Leadtools.Forms 
 
Public 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 
using Leadtools.Forms; 
 
public 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); 
} 

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