Products | Support | Back to Introduction | Email a link to this topic. | Back to Introduction - All Topics | Help Version 19.0.4.12
|
Leadtools.Forms Namespace > LogicalSize Structure : ConvertTo Method |
public LogicalSize ConvertTo( double sourceDpiX, double sourceDpiY, LogicalUnit destinationUnit, double destinationDpiX, double destinationDpiY )
'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 LogicalSize
'Usage Dim instance As LogicalSize Dim sourceDpiX As Double Dim sourceDpiY As Double Dim destinationUnit As LogicalUnit Dim destinationDpiX As Double Dim destinationDpiY As Double Dim value As LogicalSize value = instance.ConvertTo(sourceDpiX, sourceDpiY, destinationUnit, destinationDpiX, destinationDpiY)
public: LogicalSize ConvertTo( double sourceDpiX, double sourceDpiY, LogicalUnit destinationUnit, double destinationDpiX, double destinationDpiY )
This example creates a new LogicalSize structure in inches then converts it to another LogicalSize structure in pixels.
Imports Leadtools.Forms <TestMethod> _ Public Sub LogicalSize_ConvertTo() ' create a new logical size that is 1.5 and 2 inches Dim sz1 As LogicalSize = New LogicalSize(1.5F, 2.0F, LogicalUnit.Inch) ' show the size Dim s As String = String.Format("{0}", sz1) MessageBox.Show(s) ' convert the size to pixels Dim sz2 As LogicalSize = sz1.ConvertTo(150, 150, LogicalUnit.Pixel, 150, 150) ' show s = String.Format("{0}", sz2) MessageBox.Show(s) End Sub
using Leadtools.Forms; public void LogicalSize_ConvertTo() { // create a new logical size that is 1.5 and 2 inches LogicalSize sz1 = new LogicalSize(1.5f, 2f, LogicalUnit.Inch); // show the size string s = string.Format("{0}", sz1); MessageBox.Show(s); // convert the size to pixels LogicalSize sz2 = sz1.ConvertTo(150, 150, LogicalUnit.Pixel, 150, 150); // show s = string.Format("{0}", sz2); MessageBox.Show(s); }