L_AnnChangeUserHandle

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnChangeUserHandle( hObject, nIndex, pAnnHandle)

HANNOBJECT hObject;

/* handle to the annotation object */

L_INT32 nIndex;

/* index of the user handle to change */

pANNHANDLE pAnnHandle;

/* pointer to a structure that defines how to change the user handle */

Changes properties of an existing user-defined annotation handle. This function is available in the Document/Medical Toolkits.

Parameter

Description

hObject

Handle to the annotation object for which to change the user handle.

nIndex

Index of the user handle to change. This index is zero-based.

pAnnHandle

Pointer to a structure that defines how to change the user handle.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

Use this function to change the properties of an existing user-defined annotation handle.

This function is used in conjunction with the L_AnnAddUserHandle and L_AnnEnumerateHandles and L_AnnChangeUserHandle functions.

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 95 / 98 / Me, Windows 2000 / XP.

See Also

Functions:

L_AnnDefine, L_AnnAddUserHandle, L_AnnAdjustPoint, L_AnnConvert, L_AnnDefine2, L_AnnDeleteUserHandle, L_AnnEnumerateHandles, L_AnnGetRestrictToContainer, L_AnnGetRotateAngle, L_AnnGetUserHandle, L_AnnGetUserHandles, L_AnnHitTestExt, 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 changes the first user handle of an object by
// * Moving handle ten pixels to the left
// * Changing color of handle to blue
// * Changing shape of handle to square
// * Displays the hour glass cursor when mouse over the handle
L_VOID ExampleAnnChangeUserHandle(HANNOBJECT hObject)
{
   L_UINT uCount;
   ANNHANDLE AnnHandle;

   // Get the total count of user handles
   L_AnnGetUserHandles(hObject, NULL, &uCount);
   if (uCount > 0)
   {
      memset(&AnnHandle, 0, sizeof(ANNHANDLE));
      AnnHandle.uStructSize = sizeof(&AnnHandle);
      L_AnnGetUserHandle(hObject, 0, &AnnHandle);

      AnnHandle.aptContainer.x +=10;
      AnnHandle.crFill = RGB(0,0,255);
      AnnHandle.nShape = ANNHANDLE_SHAPE_SQUARE;
      AnnHandle.hCursor = LoadCursor(NULL,IDC_APPSTARTING);
      AnnHandle.uFlags = ANNHANDLE_FILL_COLOR | ANNHANDLE_SHAPE | ANNHANDLE_LOCATION | ANNHANDLE_CONTAINER_COORDINATES;
      L_AnnChangeUserHandle(hObject, 0, &AnnHandle);
   }
   else
      MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}