#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnGetItem(hContainer, phItem)

HANNOBJECT hContainer;

handle of the container object


address of the variable to be updated

Gets the handle to the first annotation object in the specified container.




Handle of the container object.


Address of the HANNOBJECT variable to be updated with the objects handle. If the container does not have any objects, the updated value is NULL.



The function was successful.

< 1

An error occurred. Refer to Return Codes.


You can use this function to see if a container is empty.

Before calling this function, you must declare a variable of data type HANNOBJECT. Then, pass the address of the variable in the phItem parameter. This function will update the variable with the handle of the first object in the container.

Required DLLs and Libraries


For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.


Win32, x64.

See Also


L_AnnGetContainer, L_AnnInsert, L_AnnRemove, L_AnnGetTopContainer, L_AnnEnumerate


Annotation Functions: Creating and Deleting Annotations


Annotation Functions: Object Information


Implementing Annotations


Implementing an Automated Annotation Program


Implementing a Non-automated Annotation Program


Obtaining Annotation Object Information


This example deletes the object that is passed in, if it is an empty subcontainer.

L_INT AnnGetItemExample(HANNOBJECT hObject) 
   L_INT nRet; 
   L_UINT      ObjectType;       /* Type of annotation object */ 
   HANNOBJECT  hTestObject; 
   HANNOBJECT  hRootContainer;   /* Root container for the whole window */ 
   /* Get the root container */ 
   nRet = L_AnnGetTopContainer(hObject, &hRootContainer); 
   if(nRet != SUCCESS) 
      return nRet; 
   /* Do nothing if this is the root container */ 
   if (hObject == hRootContainer) 
      return 0; 
   /* See if this is a container */ 
   nRet = L_AnnGetType(hObject, &ObjectType); 
   if(nRet != SUCCESS) 
      return nRet; 
   /* Do nothing if it is not a container */ 
   if (ObjectType != ANNOBJECT_CONTAINER) 
      return 0; 
   /* See if there are any objects in the container */ 
   nRet = L_AnnGetItem(hObject, &hTestObject); 
   if(nRet != SUCCESS) 
      return nRet; 
   /* If there are none, delete the container */ 
   if (hTestObject == NULL) 
      nRet = L_AnnDestroy(hObject, 0); 
      if(nRet != SUCCESS) 
         return nRet; 
      MessageBox (NULL, TEXT("Deleted empty container"), TEXT("Notice"), MB_OK); 
   return SUCCESS; 

Help Version 20.0.2018.7.30
Products | Support | Contact Us | Copyright Notices
© 1991-2018 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help