LImageViewerCell::FreezeSubCell

#include "ltwrappr.h"

L_INT LImageViewerCell::FreezeSubCell(nSubCellIndex, bFreeze, uFlags)

Freezes the sub-cell with the specified index.

Parameters

L_INT nSubCellIndex

A zero-based index into the image list attached to the cell. This sub-cell will be toggled to frozen or not frozen. Pass -1 to apply this effect on all sub-cells. Pass -2 to apply this effect on the selected sub-cell.

L_BOOL bFreeze

Flag that indicates whether to freeze or unfreeze the sub-cell at the specified index. Possible values are:

Value Meaning
TRUE Freeze the sub-cell.
FALSE Unfreeze the sub-cell.

L_UINT uFlags

Flags that determine whether to apply the feature on the one cell only, or more than one cell. This value can only be used when the cell is attached to the LImageViewer through the function LImageViewer::InsertCell. Possible values are:

Value Meaning
CELL_APPLYTOTHIS [0x00000000] Apply the feature to this cell only.
CELL_APPLYTOALL [0x10000000] Apply the feature to all the cells in the Image Viewer.
CELL_APPLYTOSELECTED [0x20000000] Apply the feature to the selected cells in the Image Viewer.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

The properties of a frozen sub-cell cannot be modified except by manually setting them using LImageViewerCell::SetActionProperties function.

To determine whether a sub-cell is frozen, call the LImageViewerCell::IsSubCellFrozen function. To determine whether a cell is frozen, call LImageViewerCell::IsCellFrozen function.

To freeze all cells call LImageViewerCell::FreezeCell function.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This example will freeze the even subcell and then type the word frozen in the middle of the frozen sub-cells.

#ifdef LImageViewerChild  
class LImageViewerChild :public LImageViewerCell 
{ 
   virtual L_INT PostPaintCallBack (pDISPCONTAINERCELLINFO pCellInfo); 
}; 
#endif 
 
L_INT LImageViewerChild::PostPaintCallBack (pDISPCONTAINERCELLINFO pCellInfo) 
{ 
   if (IsSubCellFrozen(pCellInfo->nSubCellIndex, 0)) 
   { 
      HPEN hPen = CreatePen(PS_SOLID, 2, RGB(255, 0, 0)); 
      HPEN hOldPen = (HPEN)SelectObject(pCellInfo->hDC, hPen); 
      MoveToEx(pCellInfo->hDC, pCellInfo->rcRect.left, pCellInfo->rcRect.top, NULL); 
      LineTo(pCellInfo->hDC, pCellInfo->rcRect.right, pCellInfo->rcRect.bottom); 
 
      MoveToEx(pCellInfo->hDC, pCellInfo->rcRect.right, pCellInfo->rcRect.top, NULL); 
      LineTo(pCellInfo->hDC, pCellInfo->rcRect.left, pCellInfo->rcRect.bottom); 
      SelectObject(pCellInfo->hDC, hOldPen); 
      DeleteObject(hPen); 
   } 
 
   return SUCCESS; 
} 
 
L_INT LImageViewer_FreezeSubCellExample(LImageViewerCell& ImageViewerCell) 
{ 
   L_INT       nRet; 
   L_INT       nCount; 
   L_INT       nI; 
   LBitmapList BitmapList; 
 
   nRet = BitmapList.Load(MAKE_IMAGE_PATH(TEXT("image1.dcm"))); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   nRet = ImageViewerCell.SetCellBitmapList(BitmapList.GetHandle(),TRUE,0); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   nCount = BitmapList.GetItemsCount(); 
 
   for (nI = 0; nI < nCount; nI++) 
   { 
      if (((nI >> 1) << 1) == nI ) 
      { 
         nRet = ImageViewerCell.FreezeSubCell(nI, TRUE, 0); 
         if (nRet != SUCCESS) 
            return nRet; 
      } 
   } 
 
   ImageViewerCell.EnablePostPaintCallBack(TRUE); 
 
   //ImageViewerCell.RepaintCell(0, 0); 
   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