Public Shared Function GetTextSize( _
ByVal text As String, _
ByVal font As AnnFont, _
ByVal layoutArea As LeadSizeD _
) As LeadSizeD
text
The source text string
font
The font to use
layoutArea
Clipping size to use.
The size of the text.
using Leadtools.Annotations.Automation;
using Leadtools.Annotations.Engine;
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());
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document