LImageViewerCell::RegionCallBack

#include "ltwrappr.h"

virtual L_INT LImageViewerCell::RegionCallBack(hCellWnd, hRgn, nCellIndex, nSubCellIndex, uOperation)

This callback is called every time the user creates, changes or removes a region from one of the bitmaps displayed in a cell.

Parameters

HWND hCellWnd

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

HRGN hRgn

Handle to the Windows region.

L_INT nCellIndex

A zero-based index of the cell that contains the region update.

L_INT nSubCellIndex

A zero-based index of the sub-cell. This sub-cell contains the image that contains the region changed. Pass -2 to refer to the selected sub-cell.

L_UINT uOperation

The action taken regarding the existing bitmap region, if one was defined. It can be one of the following values:

Value Meaning
L_RGN_AND [0] An AND operation has been applied to the existing region.
L_RGN_SET [1] A new region has been created.
L_RGN_ANDNOTRGN [3] The existing region has been reduced.
L_RGN_OR [4] A new region has been combined with the existing one.
L_RGN_SETNOT [6] An inverted region has been created.
L_RGN_REMOVE [8] The existing region has been removed.

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 the LImageViewerCell::EnableRegionCallBack function.

Required DLLs and Libraries

See Also

Functions

Topics

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 the frames.

#ifdef LImageViewerChild  
class LImageViewerChild :public LImageViewerCell 
{ 
   virtual L_INT RegionCallBack(HWND hCellWnd, 
                                HRGN     hRgn, 
                                L_INT    nCellIndex, 
                                L_INT    nSubCellIndex, 
                                L_UINT   uOperation); 
}; 
#endif 
 
L_INT LImageViewerChild::RegionCallBack(HWND hCellWnd, 
                                        HRGN     hRgn, 
                                        L_INT    nCellIndex, 
                                        L_INT    nSubCellIndex, 
                                        L_UINT   uOperation) 
{ 
   UNREFERENCED_PARAMETER(hCellWnd); 
   UNREFERENCED_PARAMETER(hRgn); 
   UNREFERENCED_PARAMETER(uOperation); 
   UNREFERENCED_PARAMETER(nCellIndex); 
   L_INT          nCount; 
   HBITMAPLIST    hBitmapList; 
   L_HRGN         hSubCellRgn; 
   L_INT          nI; 
   LBitmapList    BitmapList; 
 
   L_INT nRet = GetCellBitmapList(&hBitmapList, 0); 
   if (nRet != SUCCESS) 
      return nRet; 
 
 
   BitmapList.SetHandle(hBitmapList); 
   nCount = BitmapList.GetItemsCount(); 
   BitmapList.SetHandle(NULL, NULL, FALSE); 
 
   GetCellRegionHandle(nSubCellIndex, &hSubCellRgn, 0); 
 
   for (nI = 0; nI < nCount; nI++) 
   { 
      if (nSubCellIndex == nI) 
         continue; 
 
      SetCellRegionHandle(nI, hSubCellRgn, L_RGN_SET, 0); 
   } 
 
   DeleteObject(hSubCellRgn); 
   return SUCCESS; 
} 
 
L_INT LImageViewer_RegionHandleExample(LImageViewerCell& ImageViewerCell) 
{ 
   ImageViewerCell.EnableRegionCallBack(TRUE); 
 
   return SUCCESS; 
} 

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

LEADTOOLS Medical Image Viewer C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.