Imports Leadtools.Forms
Private 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, 2f, 3f, 4f, 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;
private 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);
}