LAnnRectangle::GetUserHandles

Summary

Gets information about all existing user-defined annotation handles.

Syntax

#include "ltwrappr.h"

virtual L_INT LAnnRectangle::GetUserHandles(pAnnHandle, pCount)

Parameters

pANNHANDLE pAnnHandle

Array of ANNHANDLE structures to be updated with the user-defined handles.

L_UINT *pCount

Pointer to an unsigned integer used to return the total number of user handles.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

Gets an array of user-defined handles associated with the annotation object.

To use this function:

  1. Call with pAnnHandle == NULL to get the total number of user handles.
  2. Allocate memory for an array of ANNHANDLE structures.
  3. Call this function again.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

// This example displays information about all the user handles in an object

static L_VOID DumpAnnHandle(L_UINT uIndex, pANNHANDLE pAnnHandle)  
{ 
   L_TCHAR szMsg[400];  
    
   if (pAnnHandle)  
   { 
      wsprintf(szMsg, TEXT("uIndex %d\nuStructSize: %d\nnID: %d\n aptContainer[%f,%f]\nptClient[%d,%d]\nbVisible: %s\ncrPen: 0x%x\ncrFill: 0x%x\nnShape: %s\nhCursor: %s\n"), 
					uIndex,  
					pAnnHandle->uStructSize,   
					pAnnHandle->nID,  
					pAnnHandle->aptContainer.x, pAnnHandle->aptContainer.y,  
					pAnnHandle->ptClient.x,     pAnnHandle->ptClient.y,  
					pAnnHandle->bVisible ? TEXT("Visible") : TEXT("Not Visible"), 
					pAnnHandle->crPen,  
					pAnnHandle->crFill,  
					pAnnHandle->nShape == ANNHANDLE_SHAPE_SQUARE ? TEXT("Square") : TEXT("Circle"), 
					pAnnHandle->hCursor ? TEXT("Cursor") : TEXT("No Cursor") 
					);  
      MessageBox(NULL, szMsg, TEXT(""), MB_OK);  
   } 
} 
 
L_INT LAnnRectangle_GetUserHandlesExample(LAnnRectangle * LRectangle)  
{ 
	L_INT nRet; 
   L_UINT i;  
   L_UINT uCount;  
   pANNHANDLE pAnnHandle;  
 
   // Get the total count of user handles, and allocate memory 
   nRet = LRectangle->GetUserHandles(NULL, &uCount);  
	if(nRet != SUCCESS) 
		return nRet; 
   pAnnHandle = (pANNHANDLE)malloc(uCount * sizeof(ANNHANDLE));  
 
   nRet = LRectangle->GetUserHandles(pAnnHandle, &uCount);  
	if(nRet != SUCCESS) 
		return nRet; 
   for (i = 0; i<uCount; i++) 
      DumpAnnHandle(i, pAnnHandle + i);  
 
   free(pAnnHandle);  
	return SUCCESS; 
} 

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

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