Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, April 23, 2018 8:26:14 AM(UTC)

Joe Z  
Joe Z

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.html

Within 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.

LEAD Logo
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

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.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.110 seconds.