Leadtools.Annotations Requires Document/Medical product license | Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
ConvertedLeft Method
See Also  Example
Leadtools.Annotations Namespace > AnnRectangle Structure : ConvertedLeft Method



converter
The AnnUnitConverter object to be used in converting the value.
unit
Destination AnnUnit value indicating the unit of measure.
converter
The AnnUnitConverter object to be used in converting the value.
unit
Destination AnnUnit value indicating the unit of measure.
Returns the value of the left edge of this AnnRectangle structure converted to its equivalent in the specified AnnUnit unit of measure.

Syntax

Visual Basic (Declaration) 
Public Function ConvertedLeft( _
   ByVal converter As AnnUnitConverter, _
   ByVal unit As AnnUnit _
) As Single
Visual Basic (Usage)Copy Code
Dim instance As AnnRectangle
Dim converter As AnnUnitConverter
Dim unit As AnnUnit
Dim value As Single
 
value = instance.ConvertedLeft(converter, unit)
C# 
public float ConvertedLeft( 
   AnnUnitConverter converter,
   AnnUnit unit
)
C++/CLI 
public:
float ConvertedLeft( 
   AnnUnitConverter^ converter,
   AnnUnit unit
) 

Parameters

converter
The AnnUnitConverter object to be used in converting the value.
unit
Destination AnnUnit value indicating the unit of measure.

Return Value

A value for the left edge of this AnnRectangle structure, converted to its equivalent in the specified AnnUnit unit of measure.

Example

This example creates a new AnnRectangle in inches and then shows the X, Y, Left, Top, Right, Bottom, Width and Height values in pixels.

Visual BasicCopy Code
Public Sub AnnRectangle_ConvertedLeft()
   ' set up a new unit converter with 96 DPI
   Dim converter As AnnUnitConverter = New AnnUnitConverter(96, 96)
   ' create a new annotation rectangle at 1.5F, 2.0F with width, height of 3.0F, and 4.0F in inches
   Dim rc As AnnRectangle = New AnnRectangle(1.5F, 2.0F, 3.0F, 4.0F, AnnUnit.Inch)

   Dim s As String

   ' show the rectangle
   s = String.Format("Rectangle is {0}" & Constants.vbLf, rc)

   ' show the Left, Top, Right, Bottom, Width and Height of this rectangle in pixels
   s = s & String.Format("Left is {0} Pixels" & Constants.vbLf, rc.ConvertedLeft(converter, AnnUnit.Pixel))
   s = s & String.Format("Top is {0} Pixels" & Constants.vbLf, rc.ConvertedTop(converter, AnnUnit.Pixel))
   s = s & String.Format("Right is {0} Pixels" & Constants.vbLf, rc.ConvertedRight(converter, AnnUnit.Pixel))
   s = s & String.Format("Bottom is {0} Pixels" & Constants.vbLf, rc.ConvertedBottom(converter, AnnUnit.Pixel))
   s = s & String.Format("Width is {0} Pixels" & Constants.vbLf, rc.ConvertedWidth(converter, AnnUnit.Pixel))
   s = s & String.Format("Height is {0} Pixels", rc.ConvertedHeight(converter, AnnUnit.Pixel))
   MessageBox.Show(s)
End Sub
C#Copy Code
public void AnnRectangle_ConvertedLeft() 

   // set up a new unit converter with 96 DPI 
   AnnUnitConverter converter = new AnnUnitConverter(96, 96); 
   // create a new annotation rectangle at 1.5F, 2.0F with width, height of 3.0F, and 4.0F in inches 
   AnnRectangle rc = new AnnRectangle(1.5F, 2F, 3F, 4F, AnnUnit.Inch); 
 
   string s; 
 
   // show the rectangle 
   s = string.Format("Rectangle is {0}\n", rc); 
 
   // show the Left, Top, Right, Bottom, Width and Height of this rectangle in pixels 
   s = s + string.Format("Left is {0} Pixels\n", rc.ConvertedLeft(converter, AnnUnit.Pixel)); 
   s = s + string.Format("Top is {0} Pixels\n", rc.ConvertedTop(converter, AnnUnit.Pixel)); 
   s = s + string.Format("Right is {0} Pixels\n", rc.ConvertedRight(converter, AnnUnit.Pixel)); 
   s = s + string.Format("Bottom is {0} Pixels\n", rc.ConvertedBottom(converter, AnnUnit.Pixel)); 
   s = s + string.Format("Width is {0} Pixels\n", rc.ConvertedWidth(converter, AnnUnit.Pixel)); 
   s = s + string.Format("Height is {0} Pixels", rc.ConvertedHeight(converter, AnnUnit.Pixel)); 
   MessageBox.Show(s); 
}

Remarks

The converter is used to do the actual conversion. If converter is null (Nothing in Visual Basic), the default AnnUnitConverter is used (in other words, conversion will be done based on the default 96 DPI).

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also

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