Available in LEADTOOLS Medical Imaging toolkits. |
LImageViewerCell::GetCellBitmapList
#include "ltwrappr.h"
L_INT LImageViewerCell::GetCellBitmapList(phBitmapList, uFlags);
pHBITMAPLIST phBitmapList; |
/* pointer to a variable to be updated */ |
L_UINT uFlags; |
/* reserved for future use */ |
Gets the bitmap list attached to the specified cell.
Parameter |
Description |
phBitmapList |
Pointer to the variable to be updated with the cell's bitmap list. |
uFlags |
Reserved for future use. Pass 0. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
If the cell at the specified index has no image, phBitmapList will be NULL.
Call the LImageViewerCell::SetCellBitmapList function to set the bitmap list for a cell.
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 function removes the specified cell without removing its image list.
#if defined LTV17_CONFIG L_INT LImageViewer_GetCellBitmapListExample(LImageViewer& ImageViewer) { HBITMAPLIST hBitmapList; L_INT nCellIndex = 0 ; L_INT nRet = 0 ; L_INT nCount = ImageViewer.GetCellCount(0); // Check the validity of the cell index if ((nCellIndex < 0) || (nCellIndex >= nCount)) return FAILURE; // retrieve the bitmap list. LImageViewerCell * ImageViewerCell = ImageViewer.GetCellHandle(nCellIndex, 0); nRet = ImageViewerCell->GetCellBitmapList(&hBitmapList, 0); if(nRet != SUCCESS) return nRet; // remove the cell nRet = ImageViewer.RemoveCell(nCellIndex, 0); if(nRet != SUCCESS) return nRet; return SUCCESS; } L_INT LImageViewer_ImageProcessingExample(LImageViewer& ImageViewer, L_INT nCellIndex) { HBITMAPLIST hBitmapList; L_INT nRet = 0 ; L_INT nCount = ImageViewer.GetCellCount(0); LBitmapList BitmapList; LBitmap MyBitmap; // Check the validity of the cell index if ((nCellIndex < 0) || (nCellIndex >= nCount)) return FAILURE; LImageViewerCell * ImageViewerCell = ImageViewer.GetCellHandle(nCellIndex, 0); // retrieve the bitmap list. nRet = ImageViewerCell->GetCellBitmapList(&hBitmapList, 0); if(nRet != SUCCESS) return nRet; nRet = ImageViewerCell->SetCellBitmapList(NULL, 0, 0); if(nRet != SUCCESS) return nRet; BitmapList.SetHandle(hBitmapList); nRet = BitmapList.GetItem(0, &MyBitmap, sizeof(BITMAPHANDLE)); if(nRet != SUCCESS) return nRet; nRet = MyBitmap.Invert(); if (nRet != SUCCESS) return nRet; nRet = BitmapList.SetItem(0, &MyBitmap); if(nRet != SUCCESS) return nRet; hBitmapList = BitmapList.GetHandle(); nRet = ImageViewerCell->SetCellBitmapList(hBitmapList, 0, 0); BitmapList.SetHandle(NULL, 0, FALSE); return nRet; } #else L_INT LImageViewer_GetCellBitmapListExample(LImageViewer& ImageViewer) { HBITMAPLIST hBitmapList; L_INT nCellIndex = 0 ; L_INT nRet = 0 ; L_INT nCount = ImageViewer.GetCellCount(0); // Check the validity of the cell index if ((nCellIndex < 0) || (nCellIndex >= nCount)) return FAILURE; // retrieve the bitmap list. nRet = ImageViewer.GetCellBitmapList(nCellIndex, &hBitmapList, 0); if(nRet != SUCCESS) return nRet; // remove the cell nRet = ImageViewer.RemoveCell(nCellIndex, FALSE, 0); if(nRet != SUCCESS) return nRet; return SUCCESS; } L_INT LImageViewer_ImageProcessingExample(LImageViewer& ImageViewer, L_INT nCellIndex) { HBITMAPLIST hBitmapList; L_INT nRet = 0 ; L_INT nCount = ImageViewer.GetCellCount(0); LBitmapList BitmapList; LBitmap MyBitmap; // Check the validity of the cell index if ((nCellIndex < 0) || (nCellIndex >= nCount)) return FAILURE; // retrieve the bitmap list. nRet = ImageViewer.GetCellBitmapList(nCellIndex, &hBitmapList, 0); if(nRet != SUCCESS) return nRet; nRet = ImageViewer.SetCellBitmapList(nCellIndex, NULL, 0, 0); if(nRet != SUCCESS) return nRet; BitmapList.SetHandle(hBitmapList); nRet = BitmapList.GetItem(0, &MyBitmap, sizeof(BITMAPHANDLE)); if(nRet != SUCCESS) return nRet; nRet = MyBitmap.Invert(); if (nRet != SUCCESS) return nRet; nRet = BitmapList.SetItem(0, &MyBitmap); if(nRet != SUCCESS) return nRet; hBitmapList = BitmapList.GetHandle(); nRet = ImageViewer.SetCellBitmapList(nCellIndex, hBitmapList, 0, 0); BitmapList.SetHandle(NULL, 0, FALSE); return nRet; } #endif // LTV17_CONFIG