LImageViewerCell::AnnotationCallBack

#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.

Parameters

HWND hCellWnd

A handle to the window that represents the Medical Viewer Cell.

L_UINT uMessage

Value that represents the message from the mouse.  Possible values are:WM_LBUTTONDOWNWM_LBUTTONUPWM_MBUTTONDOWNWM_MBUTTONUPWM_MOUSEMOVEWM_RBUTTONDOWNWM_RBUTTONUP

L_INT nX

A Value that represents the X position of the cursor.

L_INT nY

A Value that represents the Y position of the cursor.

L_INT nCellIndex

Index of the cell that contains the sub-cell that annotation object

L_INT nSubCellIndex

Index of the sub-cell that contains that annotation object.

Returns

Value Meaning
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 LImageViewerCell::EnableAnnotationCreatedCallBack function.

Required DLLs and Libraries

See Also

Functions

Topics

Example

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; 
} 

Help Version 20.0.2019.9.19
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Medical Image Viewer C++ Class Library Help