L_DispContainerFreezeSubCell

#include "l_bitmap.h"

L_LTIVW_API L_INT EXT_FUNCTION L_DispContainerFreezeSubCell(hCellWnd, nSubCellIndex, bFreeze, uFlags)

Freezes the sub-cell with the specified index.

Parameters

L_HWND hCellWnd

A handle to the window that represents the cell on which the function's effect will be applied.

L_INT nSubCellIndex

A zero-based index into the image list attached to the cell specified in nCellIndex. 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

Reserved for future use. Pass 0.

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 L_DispContainerSetActionProperties function.

To determine whether a sub-cell is frozen, call the L_DispContainerIsSubCellFrozen function. To determine whether a cell is frozen, call L_DispContainerIsCellFrozen function.

To freeze all cells call L_DispContainerFreezeCell function.

Required DLLs and Libraries

Platforms

The toolkit comes in Win32 and x64 editions that can support development of software applications for any of the following environments:

Windows 10

Windows 8

Windows 7

Windows Vista

Windows XP

Windows 2000

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.

L_INT EXT_CALLBACK PostPaintCallBack (HWND hCellWnd, 
                                      pDISPCONTAINERCELLINFO pCellInfo, 
                                      L_VOID *               pUserData) 
{ 
   UNREFERENCED_PARAMETER(hCellWnd); 
   UNREFERENCED_PARAMETER(pUserData); 
 
   if (L_DispContainerIsSubCellFrozen(hCellWnd, pCellInfo->nSubCellIndex, 0)) 
   { 
      HPEN hPen = CreatePen(PS_SOLID, 2, RGB(255, 0, 0)); 
      HPEN hOldPen = SelectPen(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); 
      SelectPen(pCellInfo->hDC, hOldPen); 
      DeletePen(hPen); 
   } 
 
   return SUCCESS; 
} 
 
L_INT DispContainerFreezeSubCellExample(HDISPCONTAINER hCon) 
{ 
   L_INT       nRet; 
   HBITMAPLIST hBitmapList; 
   L_INT       nCount; 
   L_INT       nI; 
   DISPCONTAINERPOSTPAINTCALLBACK 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); 
 
   nRet = L_DispContainerGetCellBitmapList(hCellWnd, &hBitmapList, 0); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   L_GetBitmapListCount(hBitmapList, (L_UINT *)&nCount); 
 
 
   for (nI = 0; nI < nCount; nI++) 
   { 
      if (((nI >> 1) << 1) == nI ) 
         L_DispContainerFreezeSubCell(hCellWnd, nI, TRUE, 0); 
   } 
 
   L_DispContainerGetPostPaintCallBack(hCellWnd, &oldCallBack, &pOldUserData); 
 
   L_DispContainerSetPostPaintCallBack(hCellWnd, PostPaintCallBack, (L_VOID *)hCon); 
 
   L_DispContainerRepaintCell(hCellWnd, 0); 
   return SUCCESS; 
} 

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

LEADTOOLS Medical Image Viewer C API Help