L_DispContainerGetAnnotationCallBack

#include "l_bitmap.h"

L_LTIVW_API L_INT EXT_FUNCTION L_DispContainerGetAnnotationCallBack(hCellWnd, ppfnCallBack, ppUserData)

HWND hCellWnd;

/* handle to the cell window */

DISPCONTAINERANNOTATIONCALLBACK * ppfnCallBack;

/* pointer to the callback function */

LPVOID * ppUserData;

/* pointer to be updated with user data */

Gets the current annotation callback function along with the user data, which were set using L_DispContainerSetAnnotationCallBack.

Parameter

Description

hCellWnd

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

ppfnCallBack

Pointer to a pointer to a callback function to be updated with the last annotation callback function set using L_DispContainerSetAnnotationCallBack.

ppUserData

Void pointer to be updated with the value of user defined data associated with the tag callback. If you are not interested in the user-defined data, pass NULL for this parameter.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

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

Functions:

L_DispContainerGetMouseCallBack, L_DispContainerSetMouseCallBack, L_DispContainerSetActionCallBack, L_DispContainerSetTagCallBack, L_DispContainerGetTagCallBack, L_DispContainerSetAnnotationCallBack, L_DispContainerGetAnnotationCreatedCallBack, L_DispContainerSetAnnotationCreatedCallBack, L_DispContainerGetPrePaintCallBack, L_DispContainerSetPrePaintCallBack, DISPCONTAINERPREPAINTCALLBACK, L_DispContainerGetPostPaintCallBack, L_DispContainerSetPostPaintCallBack, DISPCONTAINERPOSTPAINTCALLBACK, DISPCONTAINERANNOTATIONCALLBACK, DISPCONTAINERANNOTATIONCREATEDCALLBACK, DISPCONTAINERTAGCALLBACK, DISPCONTAINERACTIONCALLBACK

Topics:

Image Viewer Cells

 

Image Viewer Functions: Image Viewer Cells

Example

This example will convert the rectangle, ellipse or hilite annotation into region once the user clicks on them.

#if defined LEADTOOLS_V17_OR_LATER
L_INT EXT_CALLBACK AnnotationCallBack(HWND hCellWnd,
                                      L_UINT   uMessage,
                                      L_INT    nX,
                                      L_INT    nY,
                                      L_INT    nCellIndex,
                                      L_INT    nSubCellIndex,
                                      L_VOID * pUserData)
{
   UNREFERENCED_PARAMETER(nX);
   UNREFERENCED_PARAMETER(nY);
   UNREFERENCED_PARAMETER(nCellIndex);
   UNREFERENCED_PARAMETER(uMessage);
   UNREFERENCED_PARAMETER(pUserData);

   DISPCONTAINERANNATTRIBS AnnAttrib;


   AnnAttrib.uStructSize = sizeof(DISPCONTAINERANNATTRIBS);
   L_DispContainerGetSelectedAnnotationAttributes(hCellWnd, nSubCellIndex, &AnnAttrib, 0);

   switch(AnnAttrib.uType)
   {
   case ANNOBJECT_RECT:
   case ANNOBJECT_ELLIPSE:
   case ANNOBJECT_HILITE:
      L_DispContainerAnnToRgn(hCellWnd, nSubCellIndex, L_RGN_OR, TRUE, 0);
      break;
   }

   return SUCCESS;
}

L_INT DispContainerAnnotationCallbacksExample(HDISPCONTAINER hCon)
{
   DISPCONTAINERANNOTATIONCALLBACK oldCallBack;
   L_VOID *                        pOldUserData;

   if (L_DispContainerGetCellCount(hCon, 0) == 0)
   {
      MessageBox(NULL, TEXT("you must at least have one cell added to the viewer"), TEXT("No Cell attached"), MB_OK);
      return FAILURE;
   }

   HWND hCellWnd = L_DispContainerGetCellWindowHandle(hCon, 0, 0);

   L_DispContainerGetAnnotationCallBack(hCellWnd, &oldCallBack, &pOldUserData);

   L_DispContainerSetAnnotationCallBack(hCellWnd, AnnotationCallBack, hCon);

   return SUCCESS;
}


#else



L_INT EXT_CALLBACK AnnotationCallBack(L_UINT   uMessage,
                                      L_INT    nX,
                                      L_INT    nY,
                                      L_INT    nCellIndex,
                                      L_INT    nSubCellIndex,
                                      L_VOID * pUserData)
{
   UNREFERENCED_PARAMETER(nX);
   UNREFERENCED_PARAMETER(nY);
   UNREFERENCED_PARAMETER(uMessage);

   HDISPCONTAINER hCon = (HDISPCONTAINER)pUserData;
   DISPCONTAINERANNATTRIBS AnnAttrib;

   AnnAttrib.uStructSize = sizeof(DISPCONTAINERANNATTRIBS);
   L_DispContainerGetSelectedAnnotationAttributes(hCon, nCellIndex, nSubCellIndex, &AnnAttrib, 0);

   switch(AnnAttrib.uType)
   {
   case ANNOBJECT_RECT:
   case ANNOBJECT_ELLIPSE:
   case ANNOBJECT_HILITE:
      L_DispContainerAnnToRgn(hCon, nCellIndex, nSubCellIndex, L_RGN_OR, TRUE, 0);
      break;
   }

   return SUCCESS;
}

L_INT DispContainerAnnotationCallbacksExample(HDISPCONTAINER hCon)
{
   DISPCONTAINERANNOTATIONCALLBACK oldCallBack;
   L_VOID *                        pOldUserData;

   L_DispContainerGetAnnotationCallBack(hCon, &oldCallBack, &pOldUserData);

   L_DispContainerSetAnnotationCallBack(hCon, AnnotationCallBack, hCon);

   return SUCCESS;
}


#endif