←Select platform

AnnLayer Class

Summary

Defines an annotation layer to logically group common annotations objects.

Syntax
C#
VB
Objective-C
C++
Java
public class AnnLayer 
Public Class AnnLayer  
@interface LTAnnLayer; 
public class AnnLayer 
public: 
   ref class AnnLayer 

Remarks

AnnLayer objects can be used to logically group common annotation objects. An AnnContainer object contains a collection of AnnObjects (AnnContainer.Children) and a collection of AnnLayers (AnnContainer.Layers). The layers are organized in a parent/children tree collection, with the main container defined as the root layer. The parent/children relationship controls the z-order of the objects in the layer as well as how the various hit-test methods are performed on the container. It also controls the z-ordering used when designing or running automation.

Each AnnObject in the container is also included in a layer in the same container (by default, they are added to the root layer which is the container itself).

If required, a layer hierarchy can be created inside the container using the following steps:

  • Create a new layer with the AnnContainer.Create method and then add it to the AnnContainer.Layers collection. This adds the layer to the default root layer in the container
  • Alternatively, you can add the new layer to an existing layer as a child using the AnnLayer.Layers collection.
  • Annotation objects that are already added to the AnnContainer can then be added into any layer in the same container to group them logically using the AnnLayer.Children collection. Note that adding the object to layers does not remove it from the main container.

After a layer hierarchy is created, you can use the following methods to easily manipulate the layers:

Any layer can be designated as the active layer in the container using AnnContainer.ActiveLayer. The active container is null by default denoting the default layer in the container. When new objects are drawn in the container using automation, they are added to the active container.

The layer hierarchy is automatically saved and loaded using AnnCodecs.

Example

For an example, refer to the AnnotationsLayerDemo in your LEADTOOLS setup.

Requirements

Target Platforms

Help Version 20.0.2020.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations.Engine Assembly