#include "l_bitmap.h"
L_LTANN_API L_INT L_AnnAddUserHandle(hObject, pAnnHandle)
Adds a user-defined handle to an annotation object, where pAnnHandle is a pointer to the structure defining an annotation handle.
Handle to the annotation object to which to add the user handle.
Pointer to a structure that defines the user handle.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Before calling this function, you must create the annotation object.
Call this function one or more times to add user handles to an existing annotation object.
The user handle location can be defined using container coordinates or client coordinates.
Client coordinates factor in the current zoom factor, and the horizontal and vertical scrolling.
For more information on defining a user handle, see the documentation for the ANNHANDLE structure.
Required DLLs and Libraries
Win32, x64.
This example adds user handles to the center of the top and bottom lines of a rectangle.
// hRect is a rectangle.
L_INT AnnAddUserHandleExample(HANNOBJECT hRect)
{
L_INT nRet;
ANNHANDLE AnnHandle;
L_UINT uType;
ANNRECT arc;
nRet = L_AnnGetType(hRect, &uType);
if(nRet != SUCCESS)
return nRet;
if (uType == ANNOBJECT_RECT)
{
nRet = L_AnnGetRect(hRect, &arc, NULL);
if(nRet != SUCCESS)
return nRet;
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(ANNHANDLE);
AnnHandle.nID = 100;
AnnHandle.bVisible = TRUE;
AnnHandle.crPen = RGB(0,0,0);
AnnHandle.crFill = RGB(255,0,0);
AnnHandle.nShape = ANNHANDLE_SHAPE_CIRCLE;
AnnHandle.hCursor = NULL;
AnnHandle.uFlags = ANNHANDLE_ID | ANNHANDLE_LOCATION |
ANNHANDLE_CONTAINER_COORDINATES | ANNHANDLE_VISIBLE |
ANNHANDLE_PEN_COLOR | ANNHANDLE_FILL_COLOR | ANNHANDLE_SHAPE;
AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.top;
nRet = L_AnnAddUserHandle(hRect, &AnnHandle);
if(nRet != SUCCESS)
return nRet;
AnnHandle.aptContainer.x = (arc.left + arc.right)/2;
AnnHandle.aptContainer.y = arc.bottom;
nRet = L_AnnAddUserHandle(hRect, &AnnHandle);
if(nRet != SUCCESS)
return nRet;
}
else
{
MessageBox(NULL, TEXT("Annotation object must be a Rectangle."), TEXT("Error"), MB_OK);
return 0;
}
return SUCCESS;
}
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