LEADTOOLS Forms (Leadtools.Forms assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
Width Property
See Also 
Leadtools.Forms Namespace > LogicalSize Structure : Width Property



The Width Property is available as an add-on to the LEADTOOLS Document and Medical Imaging toolkits.

Gets or sets a value that represents the width for this LogicalSize.

Syntax

Visual Basic (Declaration) 
Public Property Width As Double
Visual Basic (Usage)Copy Code
Dim instance As LogicalSize
Dim value As Double
 
instance.Width = value
 
value = instance.Width
C# 
public double Width {get; set;}
C++/CLI 
public:
property double Width {
   double get();
   void set (    double value);
}

Property Value

Value that indicates the width of the size.

Example

This example converts the width and height from inch to pixels units.

Visual BasicCopy Code
Public Sub LogicalSize_ConvertedWidthHeight()
   ' create a new logical size with dimension of 1.5, 2 in inches
   Dim sz As LogicalSize = New LogicalSize(1.5f, 2f, LogicalUnit.Inch)
   Dim s As String
   ' show the size
   s = String.Format("Size is {0}", sz)
   MessageBox.Show(s)

   ' show the width and height components converted to pixels
   s = String.Format("width and height is {0}, {1} Pixels", LogicalUnitConverter.Convert(sz.Width, LogicalUnit.Inch, 150, LogicalUnit.Pixel, 150), LogicalUnitConverter.ConvertToPixels(sz.Height, LogicalUnit.Inch, 150))
   MessageBox.Show(s)
End Sub
C#Copy Code
public void LogicalSize_ConvertedWidthHeight()
{
   // create a new logical size with dimension of 1.5, 2 in inches
   LogicalSize sz = new LogicalSize(1.5f, 2f, LogicalUnit.Inch);
   string s;
   // show the size
   s = string.Format("Size is {0}", sz);
   MessageBox.Show(s);

   // show the width and height components converted to pixels
   s = string.Format("width and height is {0}, {1} Pixels", LogicalUnitConverter.Convert(sz.Width, LogicalUnit.Inch, 150, LogicalUnit.Pixel, 150), LogicalUnitConverter.ConvertToPixels(sz.Height, LogicalUnit.Inch, 150));
   MessageBox.Show(s);
}

Requirements

Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7

See Also

Leadtools.Forms requires a Forms Module license and unlock key. For more information, refer to: Imaging Pro/Document/Medical Features