#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.
A handle to the window that represents the Medical Viewer Cell.
Handle to the Windows region.
A zero-based index of the cell that contains the region update.
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.
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. |
| Value | Meaning |
|---|---|
| SUCCESS | The function was successful. |
| < 1 | An error occurred. Refer to Return Codes. |
In order to use this callback function, it must first be set by calling the LImageViewerCell::EnableRegionCallBack function.
Required DLLs and Libraries
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 LImageViewerChildclass LImageViewerChild :public LImageViewerCell{virtual L_INT RegionCallBack(HWND hCellWnd,HRGN hRgn,L_INT nCellIndex,L_INT nSubCellIndex,L_UINT uOperation);};#endifL_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;}