L_DispContainerGetRegionCallBack

#include "l_bitmap.h"

L_LTIVW_API L_INT EXT_FUNCTION L_DispContainerGetRegionCallBack(hCellWnd, ppfnCallBack, ppUserData)

HWND hCellWnd;

/* handle to the cell window */

DISPCONTAINERREGIONCALLBACK * ppfnCallBack;

/* pointer to the callback function */

LPVOID * ppUserData;

/* pointer to be updated with user data */

Gets the current action callback function along with the user data, which were set using L_DispContainerSetRegionCallBack.

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 pre-paint callback function set using L_DispContainerSetPrePaintCallBack.

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_DispContainerSetMouseCallBack, L_DispContainerSetActionCallBack, L_DispContainerSetTagCallBack, L_DispContainerGetTagCallBack, L_DispContainerSetAnnotationCallBack, L_DispContainerGetAnnotationCallBack, L_DispContainerGetAnnotationCreatedCallBack, L_DispContainerSetAnnotationCreatedCallBack, L_DispContainerSetPrePaintCallBack, L_DispContainerGetPrePaintCallBack, DISPCONTAINERPREPAINTCALLBACK, L_DispContainerGetPostPaintCallBack, L_DispContainerSetPostPaintCallBack, DISPCONTAINERPOSTPAINTCALLBACK, DISPCONTAINERANNOTATIONCALLBACK, DISPCONTAINERANNOTATIONCREATEDCALLBACK, DISPCONTAINERTAGCALLBACK, DISPCONTAINERACTIONCALLBACK

Topics:

Image Viewer Cells

 

Image Viewer Functions: Image Viewer Cells

Example

This function will make the cell set the region handle for all the frame if the user create or updated a region on one of hte frames.

#if defined LEADTOOLS_V17_OR_LATER

L_INT EXT_CALLBACK RegionCallBack(HWND hCellWnd,
                                  HRGN     hRgn,
                                  L_INT    nCellIndex,
                                  L_INT    nSubCellIndex,
                                  L_UINT   uOperation,
                                  L_VOID * pUserData)

{
   UNREFERENCED_PARAMETER(hRgn);
   UNREFERENCED_PARAMETER(nCellIndex);
   UNREFERENCED_PARAMETER(uOperation);
   UNREFERENCED_PARAMETER(pUserData);
   L_INT          nCount;
   HBITMAPLIST    hBitmapList;
   L_HRGN         hSubCellRgn;
   L_INT          nI;

   L_INT nRet = L_DispContainerGetCellBitmapList(hCellWnd, &hBitmapList, 0);
   if (nRet != SUCCESS)
      return nRet;

   L_GetBitmapListCount(hBitmapList, (L_UINT *)&nCount);

   L_DispContainerGetCellRegionHandle(hCellWnd, nSubCellIndex, &hSubCellRgn, 0);

   for (nI = 0; nI < nCount; nI++)
   {
      if (nSubCellIndex == nI)
         continue;

      L_DispContainerSetCellRegionHandle(hCellWnd, nI, hSubCellRgn, L_RGN_SET, 0);
   }

   DeleteRgn(hSubCellRgn);
   return SUCCESS;
}



L_INT DispContainerRegionHandleExample(HDISPCONTAINER hCon)
{
   DISPCONTAINERREGIONCALLBACK oldCallBack;

   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_DispContainerGetRegionCallBack(hCellWnd, &oldCallBack, NULL);
   L_DispContainerSetRegionCallBack(hCellWnd, RegionCallBack, hCon);

   return SUCCESS;
}




#else




L_INT EXT_CALLBACK RegionCallBack(HRGN     hRgn,
                                  L_INT    nCellIndex,
                                  L_INT    nSubCellIndex,
                                  L_UINT   uOperation,
                                  L_VOID * pUserData)

{
   UNREFERENCED_PARAMETER(hRgn);
   UNREFERENCED_PARAMETER(uOperation);
   HDISPCONTAINER hCon = (HDISPCONTAINER)pUserData;
   L_INT          nCount;
   HBITMAPLIST    hBitmapList;
   L_HRGN         hSubCellRgn;
   L_INT          nI;

   L_INT nRet = L_DispContainerGetCellBitmapList(hCon, 0, &hBitmapList, 0);
   if (nRet != SUCCESS)
      return nRet;

   L_GetBitmapListCount(hBitmapList, (L_UINT *)&nCount);

   L_DispContainerGetCellRegionHandle(hCon, nCellIndex, nSubCellIndex, &hSubCellRgn, 0);

   for (nI = 0; nI < nCount; nI++)
   {
      if (nSubCellIndex == nI)
         continue;

      L_DispContainerSetCellRegionHandle(hCon, nCellIndex, nI, hSubCellRgn, L_RGN_SET, 0);
   }

   DeleteRgn(hSubCellRgn);
   return SUCCESS;
}



L_INT DispContainerRegionHandleExample(HDISPCONTAINER hCon)
{
   DISPCONTAINERREGIONCALLBACK oldCallBack;

   L_DispContainerGetRegionCallBack(hCon, &oldCallBack, NULL);
   L_DispContainerSetRegionCallBack(hCon, RegionCallBack, hCon);

   return SUCCESS;
}




#endif