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 > LogicalRectangle Structure : Convert Method |
public void Convert( double sourceDpiX, double sourceDpiY, LogicalUnit destinationUnit, double destinationDpiX, double destinationDpiY )
'Declaration Public Sub Convert( _ ByVal sourceDpiX As Double, _ ByVal sourceDpiY As Double, _ ByVal destinationUnit As LogicalUnit, _ ByVal destinationDpiX As Double, _ ByVal destinationDpiY As Double _ )
'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 instance.Convert(sourceDpiX, sourceDpiY, destinationUnit, destinationDpiX, destinationDpiY)
public: void Convert( double sourceDpiX, double sourceDpiY, LogicalUnit destinationUnit, double destinationDpiX, double destinationDpiY )
This example creates a new LogicalRectangle structure in inches then converts it to pixels.
Imports Leadtools.Forms <TestMethod> _ Public 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, 2.0F, 3.0F, 4.0F, 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
using Leadtools.Forms; public 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); }