LEADTOOLS Support
Imaging
Imaging SDK Examples
HOW TO: Edit Default Annotation Objects using the ObjectTemplate Property
#1
Posted
:
Monday, April 23, 2018 8:26:14 AM(UTC)
Groups: Registered, Tech Support, Administrators
Posts: 63
Thanks: 2 times
Was thanked: 4 time(s) in 4 post(s)
When creating LEADTOOLS Annotations objects, some users may which to change the default annotations settings such as Color, Fill, Stroke-width etc. By using the AnnAutomationObjects ObjectTemplate property, users can change the default properties of a specific object whenever an instance is created.
https://www.leadtools.com/help/leadtools/v20/dh/aa/annautomationobject-objecttemplate.htmlWithin your project, after creating the default automation objects, you can use the AutomationManagers FindObjectById method to edit the particular annotation object that you want. In this case, we're editing the AnnRectangleObject. Afterwards, you can use the ObjectTemplate property and cast the object into your AnnObject to edit it's particular settings such as Fill and Stroke.
Code:AnnAutomationObject customAnn = _automationManager.FindObjectById(AnnObject.RectangleObjectId);
AnnRectangleObject customRect = (AnnRectangleObject)customAnn.ObjectTemplate;
customRect.Fill = null;
customRect.Stroke = AnnStroke.Create(AnnSolidColorBrush.Create("Blue"), LeadLengthD.Create(50));
From these steps, we have edited the default standard AnnRectangleObject from having a thin red border to having a default AnnRectangleObject with a thick blue border whenever an instance is created.
Joe Zhan
Developer Support Engineer
LEAD Technologies, Inc.
LEADTOOLS Support
Imaging
Imaging SDK Examples
HOW TO: Edit Default Annotation Objects using the ObjectTemplate Property
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.