| 
   Available in LEADTOOLS Medical Imaging toolkits.  | 
LImageViewer::AnnotationCallBack
#include "ltwrappr.h"
virtual L_INT LImageViewer::AnnotationCallBack(uMessage, nX, nY, nCellIndex, nSubCellIndex)
| 
 L_UINT uMessage;  | 
 /* message */  | 
| 
 L_INT nX;  | 
 /* X mouse position */  | 
| 
 L_INT nY;  | 
 /* Y mouse position */  | 
| 
 L_INT nCellIndex;  | 
 /* index of the affected cell */  | 
| 
 L_INT nSubCellIndex;  | 
 /* index into the image list attached to the cell */  | 
This callback function is called every time the user clicks on an annotation object.
| 
 Parameter  | 
 Description  | 
| 
 uMessage  | 
 Value that represents the message from the mouse. Possible values are: WM_LBUTTONDOWN WM_LBUTTONUP WM_MBUTTONDOWN WM_MBUTTONUP WM_MOUSEMOVE WM_RBUTTONDOWN WM_RBUTTONUP  | 
| 
 nX  | 
 A Value that represents the X position of the cursor.  | 
| 
 nY  | 
 A Value that represents the Y position of the cursor.  | 
| 
 nCellIndex  | 
 Index of the cell that contains the sub-cell that annotation object  | 
| 
 nSubCellIndex  | 
 Index of the sub-cell that contains that annotation object.  | 
Returns
| 
 SUCCESS  | 
 The function was successful.  | 
| 
 < 1  | 
 An error occurred. Refer to Return Codes.  | 
Comments
In order to use this callback function, it must first be set by calling LImageViewer::EnableAnnotationCreatedCallBack function.
Required DLLs and Libraries
| 
 LTIVW For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.  | 
See Also
Example
This example will convert the rectangle, ellipse or hilite annotation into region once the user clicks on them.
#ifdef LImageViewerChild 
class LImageViewerChild :public LImageViewer
{
   virtual L_INT AnnotationCallBack(L_UINT   uMessage,
                                    L_INT    nX,
                                    L_INT    nY,
                                    L_INT    nCellIndex,
                                    L_INT    nSubCellIndex);
};
#endif
L_INT LImageViewerChild ::AnnotationCallBack(L_UINT   uMessage,
                                             L_INT    nX,
                                             L_INT    nY,
                                             L_INT    nCellIndex,
                                             L_INT    nSubCellIndex)
{
   UNREFERENCED_PARAMETER(nX);
   UNREFERENCED_PARAMETER(nY);
   UNREFERENCED_PARAMETER(uMessage);
   DISPCONTAINERANNATTRIBS AnnAttrib;
   AnnAttrib.uStructSize = sizeof(DISPCONTAINERANNATTRIBS);
   GetSelectedAnnotationAttributes( nCellIndex, nSubCellIndex, &AnnAttrib, 0);
   switch(AnnAttrib.uType)
   {
   case ANNOBJECT_RECT:
   case ANNOBJECT_ELLIPSE:
   case ANNOBJECT_HILITE:
      AnnToRgn( nCellIndex, nSubCellIndex, L_RGN_OR, TRUE, 0);
      break;
   }
   return SUCCESS;
}
L_INT LImageViewer_AnnotationCallbacksExample(LImageViewer& ImageViewer)
{
   ImageViewer.EnableAnnotationCallBack(TRUE);
   return SUCCESS;
}