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());
}