C#
VB
C++
Returns the size of a text with a AnnFont and clipping size.
Public Shared Function GetTextSize( _ByVal text As String, _ByVal font As Leadtools.Annotations.Core.AnnFont, _ByVal layoutArea As Leadtools.LeadSizeD _) As Leadtools.LeadSizeD
text
The source text string
font
The font to use
layoutArea
Clipping size to use.
The size of the text.
using LeadtoolsExamples.Common;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 containerAnnContainer container = _automation.Container;// Create a new AnnTextObjectAnnTextObject 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 stringLeadSizeD size = AnnWinFormsRenderingEngine.GetTextSize(txtObject.Text, txtObject.Font, txtObject.Bounds.Size);Debug.WriteLine(size.ToString());}
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
