|
Available in LEADTOOLS Medical Imaging toolkits. |
LImageViewer::FreezeSubCell
#include "ltwrappr.h"
L_INT LImageViewer::FreezeSubCell(nCellIndex, nSubCellIndex, bFreeze, uFlags)
|
L_INT nCellIndex; |
/* index of a cell */ |
|
L_INT nSubCellIndex; |
/* index into the image list attached to the cell */ |
|
L_BOOL bFreeze; |
/* flag */ |
|
L_UINT uFlags; |
/* reserved for future use */ |
Freezes the sub-cell with the specified index.
|
Parameter |
Description |
|
|
nCellIndex |
A zero-based index of the cell that contains the sub-cell being frozen. Pass -1 to freeze the sub-cell with nSubCellIndex of all cells managed by the container. Pass -2 to freeze the sub-cell with nSubCellIndex of the selected cells managed by the container. |
|
|
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. |
|
|
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. |
|
uFlags |
Reserved for future use. Pass 0. |
|
Returns
|
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 LImageViewer::SetActionProperties function.
To determine whether a sub-cell is frozen, call the LImageViewer::IsSubCellFrozen function. To determine whether a cell is frozen, call LImageViewer::IsCellFrozen function.
To freeze all cells call LImageViewer::FreezeCell function.
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
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 LImageViewer
{
virtual L_INT PostPaintCallBack (pDISPCONTAINERCELLINFO pCellInfo);
} ;
#endif
L_INT LImageViewerChild::PostPaintCallBack (pDISPCONTAINERCELLINFO pCellInfo)
{
if (IsSubCellFrozen( pCellInfo->nCellIndex, 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(LImageViewer& ImageViewer)
{
L_INT nRet;
HBITMAPLIST hBitmapList;
L_INT nCount;
L_INT nI;
LBitmapList BitmapList;
nRet = ImageViewer.GetCellBitmapList( 0, &hBitmapList, 0);
if (nRet != SUCCESS)
return nRet;
BitmapList.SetHandle(hBitmapList);
nCount = BitmapList.GetItemsCount();
BitmapList.SetHandle(NULL, NULL, FALSE);
for (nI = 0; nI < nCount; nI++)
{
if (((nI >> 1) << 1) == nI )
ImageViewer.FreezeSubCell( 0, nI, TRUE, 0);
}
ImageViewer.EnablePostPaintCallBack(TRUE);
ImageViewer.RepaintCell( 0, 0, 0);
return SUCCESS;
}