Error processing SSI file
(Leadtools.Annotations.Rendering)

Show in webframe

GetTextSize Method (AnnWinFormsRenderingEngine)







The source text string
The font to use
Clipping size to use.
Returns the size of a text with a AnnFont and clipping size.
Syntax
public static LeadSizeD GetTextSize( 
   string text,
   AnnFont font,
   LeadSizeD layoutArea
)
'Declaration
 
Public Shared Function GetTextSize( _
   ByVal text As String, _
   ByVal font As AnnFont, _
   ByVal layoutArea As LeadSizeD _
) As LeadSizeD
'Usage
 
Dim text As String
Dim font As AnnFont
Dim layoutArea As LeadSizeD
Dim value As LeadSizeD
 
value = AnnWinFormsRenderingEngine.GetTextSize(text, font, layoutArea)
public static LeadSizeD GetTextSize( 
   string text,
   AnnFont font,
   LeadSizeD layoutArea
)
 function Leadtools.Annotations.Rendering.AnnWinFormsRenderingEngine.GetTextSize( 
   text ,
   font ,
   layoutArea 
)

Parameters

text
The source text string
font
The font to use
layoutArea
Clipping size to use.

Return Value

The size of the text.
Example
Copy Code  
using Leadtools.Annotations.Automation;
using Leadtools.Annotations.Core;
using Leadtools.Annotations.Rendering;
using Leadtools.Codecs;
using Leadtools.Annotations.WinForms;

      
public void AnnRenderingEngine_GetTextSize()
{
   double inch = 720.0;
   // Get the container
   AnnContainer container = _automation.Container;

   // Create a new AnnTextObject
   AnnTextObject txtObject = new AnnTextObject();
   txtObject.Rect = LeadRectD.Create(3 * inch, 3 * inch, 1 * inch, 1 * inch);
   txtObject.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Blue"), LeadLengthD.Create(1));
   txtObject.Text = "LEADTOOLS";

   container.Children.Add(txtObject);
   // Measure the size of a text string
   LeadSizeD size = AnnWinFormsRenderingEngine.GetTextSize(txtObject.Text, txtObject.Font, txtObject.Bounds.Size);
   Debug.WriteLine(size.ToString()); 
}
Requirements

Target Platforms

See Also

Reference

AnnWinFormsRenderingEngine Class
AnnWinFormsRenderingEngine Members

Error processing SSI file
Leadtools.Annotations.Rendering requires a Document or Medical toolkit license and unlock key. For more information, refer to: LEADTOOLS Toolkit Features