L_AnnGetRgnHandle

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnGetRgnHandle(hObject, pXForm, phRgn)

Creates a region from the specified annotation object and retrieves a handle to that region.

Parameters

HANNOBJECT hObject

Handle to the annotation object from which the region will be created.

pRGNXFORM pXForm

Pointer to an RGNXFORM structure that LEADTOOLS uses to translate between display coordinates and bitmap coordinates.

If you specify NULL in this parameter, the scalar fields default to 1, the offsets default to 0, and the view perspective defaults to TOP_LEFT.

HRGN *phRgn

Address of the variable to be updated with the handle to the region, if the function is successful.

Returns

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

Comments

You can create regions from the following annotation objects:

When working with the RGNXFORM structure in this function, consider the following:

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Topics

Example

L_INT EXT_CALLBACK AnnGetRgnHandleExample(HANNOBJECT  hObject, 
                                          L_VOID*     pUserData) 
{ 
   UNREFERENCED_PARAMETER(pUserData); 
   HRGN        hRgn; 
   RGNXFORM    XForm; 
   L_INT       nRet; 
 
   XForm.uViewPerspective  = BOTTOM_LEFT; 
   XForm.nXScalarNum       = XForm.nXScalarDen = 1; 
   XForm.nYScalarNum       = XForm.nYScalarDen = 1; 
   XForm.nXOffset          = XForm.nYOffset = 0; 
 
   nRet = L_AnnGetRgnHandle(hObject, &XForm, &hRgn); 
   if (nRet == SUCCESS) 
   { 
      MessageBox(NULL, TEXT("Got region handle."), TEXT(""), MB_OK); 
 
   } 
   return SUCCESS; 
} 
 
L_INT AnnGetRgnHandleExample_Call(HANNOBJECT hContainer) 
{ 
   L_INT       nRet = 0; 
 
   nRet = L_AnnEnumerate(hContainer, (ANNENUMCALLBACK)AnnGetRgnHandleExample, NULL, ANNFLAG_SELECTED | ANNFLAG_NOTTHIS, 0); 
 
   return nRet; 
} 
Help Version 20.0.2020.4.3
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help