Gets the handle to the first annotation object in the specified container.
#include "l_bitmap.h"
L_LTANN_API L_INT L_AnnGetItem(hContainer, phItem)
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.
Value | Meaning |
---|---|
SUCCESS | 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.
Win32, x64.
This example deletes the object that is passed in, if it is an empty sub-container.
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 SUCCESS;
/* 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 SUCCESS;
/* 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;
_tprintf(_T("%s"), TEXT("Notice: Deleted empty container."));
}
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document