#include "ltwrappr.h"
virtual L_INT LImageViewerCell::AnnotationCallBack(hCellWnd, uMessage, nX, nY, nCellIndex, nSubCellIndex)
This callback function is called every time the user clicks on an annotation object.
A handle to the window that represents the Medical Viewer Cell.
Value that represents the message from the mouse. Possible values are:WM_LBUTTONDOWNWM_LBUTTONUPWM_MBUTTONDOWNWM_MBUTTONUPWM_MOUSEMOVEWM_RBUTTONDOWNWM_RBUTTONUP
A Value that represents the X position of the cursor.
A Value that represents the Y position of the cursor.
Index of the cell that contains the sub-cell that annotation object
Index of the sub-cell that contains that annotation object.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
In order to use this callback function, it must first be set by calling LImageViewerCell::EnableAnnotationCreatedCallBack function.
Required DLLs and Libraries
This example will convert the rectangle, ellipse or hilite annotation into region once the user clicks on them.
#ifdef LImageViewerChild
class LImageViewerChild :public LImageViewerCell
{
virtual L_INT AnnotationCallBack(HWND hCellWnd,
L_UINT uMessage,
L_INT nX,
L_INT nY,
L_INT nCellIndex,
L_INT nSubCellIndex);
};
#endif
L_INT LImageViewerChild ::AnnotationCallBack(HWND hCellWnd,
L_UINT uMessage,
L_INT nX,
L_INT nY,
L_INT nCellIndex,
L_INT nSubCellIndex)
{
UNREFERENCED_PARAMETER(hCellWnd);
UNREFERENCED_PARAMETER(nCellIndex);
UNREFERENCED_PARAMETER(nX);
UNREFERENCED_PARAMETER(nY);
UNREFERENCED_PARAMETER(uMessage);
DISPCONTAINERANNATTRIBS AnnAttrib;
AnnAttrib.uStructSize = sizeof(DISPCONTAINERANNATTRIBS);
GetSelectedAnnotationAttributes(nSubCellIndex, &AnnAttrib, 0);
switch(AnnAttrib.uType)
{
case ANNOBJECT_RECT:
case ANNOBJECT_ELLIPSE:
case ANNOBJECT_HILITE:
AnnToRgn(nSubCellIndex, L_RGN_OR, TRUE, 0);
break;
}
return SUCCESS;
}
L_INT LImageViewer_AnnotationCallbacksExample(LImageViewerCell& ImageViewerCell)
{
ImageViewerCell.EnableAnnotationCallBack(TRUE);
return SUCCESS;
}