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 : Tuesday, March 12, 2013 5:51:49 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)

You can add more than one Annotation object to the same group by setting the object’s groupName property to a specific name as follows:
+-------------+
var rectObj = new lt.Annotations.Core.AnnRectangleObject();
var rectObj2 = new lt.Annotations.Core.AnnRectangleObject();
var rectObj3 = new lt.Annotations.Core.AnnRectangleObject();

rectObj.set_groupName("Group1");
rectObj2.set_groupName("Group1");
                  
rectObj3.set_groupName("Group2");
+-------------+
When using the above code, you will have two groups (Group1 and Group2):
- Group1 contains two rectangle objects (rectObj and rectObj2).
- Group2 contains one rectangle object (rectObj3).

Now, if you want to show\hide a specific group, you can do this as follows:
+-------------+
var MyObjects = _automation.get_container().get_children();                        

for (var i = 0; i < MyObjects.get_count(); i++)
{
var child = MyObjects.get_item(i);
var groupName = child.get_groupName();
                         
if(groupName.localeCompare("Group1") == 0)
{
alert("Group1");
child.set_isVisible(false);
}
else
{
alert("Group2");
child.set_isVisible(true);
_automation.selectObject(child);
}
}
+-------------+
The above code will hide all objects in Group1.

I am attaching a small LEADTOOLS v18 HTML5 project that shows how you can work with groups.

Thanks,
Maen Badwan
LEADTOOLS Technical Support
File Attachment(s):
HTML5_18_Groups.zip (3kb) downloaded 80 time(s).
 

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.211 seconds.