L_AnnEnumerateHandles

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnEnumerateHandles(hObject, pfnCallback, *pUserData)

HANNOBJECT hObject;

/* handle to the annotation object */

ANNENUMHANDLECALLBACK pfnCallback;

/* callback function for each handle */

L_VOID *pUserData;

/* pointer to more parameters for the callback */

Calls the function pfnCallback for ALL handles (both default and user-defined) for an annotation object.

This function is available in the Document and Medical Imaging toolkits.

Parameter

Description

hObject

Handle to the annotation object.

pfnCallback

Callback function for processing each enumerated object. Use the function pointer as the value of this parameter.

 

L_AnnEnumerateHandles calls this callback function for each handle (user-defined or default) for annotation object hObject. The callback function must adhere to the function prototype described in ANNENUMHANDLECALLBACK Function.

pUserData

Void pointer that you can use to pass one or more additional parameters that the callback function needs.

 

To use this feature, assign a value to a variable or create a structure that contains as many fields as you need. Then, in this parameter, pass the address of the variable or structure, casting it to L_VOID *. The callback function, which receives the address in its own pUserData parameter, can cast it to a pointer of the appropriate data type to access your variable or structure. If the additional parameters are not needed, you can pass NULL in this parameter.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Use this function to get information about all annotation handles for an annotation object.

Note that this function returns information about both default annotation handles and user-defined annotation handles.

This function can also be used to change some of the properties of an annotation handle.

For more information, refer to the ANNENUMHANDLECALLBACK function.

Required DLLs and Libraries

LTANN

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

Platforms

Windows 2000 / XP/Vista.

See Also

Functions:

L_AnnDefine, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnChangeUserHandle, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTest, L_AnnRestrictCursor, L_AnnSetRestrictToContainer

Topics:

Annotation Functions: Creating and Deleting Annotations

 

Implementing Custom Annotations

 

Implementing Annotations

 

Implementing an Automated Annotation Program

 

Implementing a Non-automated Annotation Program

Example

This example enumerates through all handles of an object, changing the predefined handles to blue squares and the user handles to red circles.

L_INT EXT_CALLBACK ColorNodesCallback(HANNOBJECT      hObject,
                                      pANNHANDLEINFO  pHandleInfo,
                                      L_VOID*         pUserData)
{
   UNREFERENCED_PARAMETER(hObject);
   UNREFERENCED_PARAMETER(pUserData);
   pHandleInfo->bVisible = TRUE;
   if (pHandleInfo->nType == ANNHANDLETYPE_DEFAULT_HANDLE)
   {
      pHandleInfo->nShape = ANNHANDLE_SHAPE_SQUARE;
      pHandleInfo->crFill = RGB(0,0,255);
   }
   else
   {
      pHandleInfo->nShape = ANNHANDLE_SHAPE_CIRCLE;
      pHandleInfo->crFill = RGB(0,255,0);
   }
   return SUCCESS_CHANGE;
}

 L_INT AnnEnumerateHandlesExample(HANNOBJECT hObject)
{
   L_INT nRet;
   nRet = L_AnnEnumerateHandles(hObject, ColorNodesCallback, NULL);
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}