L_AnnChangeUserHandle

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnChangeUserHandle(hObject, nIndex, pAnnHandle)

Changes properties of an existing user-defined annotation handle.

Parameters

HANNOBJECT hObject

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

L_INT32 nIndex

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

pANNHANDLE pAnnHandle

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

Returns

Value Meaning
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

Platforms

Win32, x64.

See Also

Functions

Topics

Example

This example changes the first user handle of an object by

  • Moving the handle ten pixels to the left
  • Changing the color of the handle to blue
  • Changing the shape of handle to square
  • Setting the handle to display the hour glass cursor when the mouse hovers over the handle
    L_INT AnnChangeUserHandleExample(HANNOBJECT hObject) 
    { 
       L_INT nRet; 
       L_UINT      uCount; 
       ANNHANDLE   AnnHandle; 
     
       // Get the total count of user handles 
       nRet = L_AnnGetUserHandles(hObject, NULL, &uCount); 
       if(nRet != SUCCESS) 
          return nRet; 
       if (uCount > 0) 
       { 
          memset(&AnnHandle, 0, sizeof(ANNHANDLE)); 
          AnnHandle.uStructSize = sizeof(&AnnHandle); 
          nRet = L_AnnGetUserHandle(hObject, 0, &AnnHandle); 
          if(nRet != SUCCESS) 
             return nRet; 
     
          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; 
     
          
          nRet = L_AnnChangeUserHandle(hObject, 0, &AnnHandle); 
          if(nRet != SUCCESS) 
             return nRet; 
       } 
       else 
       { 
          MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK); 
          return 0; 
       } 
       return SUCCESS; 
    } 
Help Version 21.0.2021.7.5
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.