Creates a region from the specified annotation object and retrieves a handle to that region.
#include "l_bitmap.h"
L_LTANN_API L_INT L_AnnGetRgnHandle(hObject, pXForm, phRgn)
Handle to the annotation object from which the region will be created.
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.
Address of the variable to be updated with the handle to the region, if the function is successful.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
You can create regions from the following annotation objects:
When working with the RGNXFORM structure in this function, consider the following:
the annotations are always TOP_LEFT.
the bitmap is missing, so the bitmap rectangle is replaced with the object rectangle.
it is easier to work with this function using TOP_LEFT as the ViewPerspective.
Win32, x64.
L_INT EXT_CALLBACK AnnGetRgnHandleExample(HANNOBJECT hObject, L_VOID* pUserData)
{
UNREFERENCED_PARAMETER(pUserData);
L_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)
_tprintf(_T("%s"), TEXT("Got region handle."));
return nRet;
}
L_INT AnnGetRgnHandleExample_Call(HANNOBJECT hContainer)
{
return L_AnnEnumerate(hContainer, (ANNENUMCALLBACK)AnnGetRgnHandleExample, NULL, ANNFLAG_SELECTED | ANNFLAG_NOTTHIS, 0);
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document