L_DispContainerGetCellBitmapList

#include "ltivw.h"

L_LTIVW_API L_INT L_DispContainerGetCellBitmapList(hCon, nCellIndex, phBitmapList, uFlags)

HDISPCONTAINER hCon;

/* handle to the container */

L_INT nCellIndex;

/* index of a cell */

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

hCon

Handle to the container.

nCellIndex

A zero-based index of the cell for which to get the bitmap list.

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 L_DispContainerSetCellBitmapList 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

Functions:

L_DispContainerCreate, L_DispContainerRemoveCell, L_DispContainerInsertCell, L_DispContainerGetCellCount, L_DispContainerGetCellWindowHandle, L_DispContainerSetCellBitmapList, L_DispContainerSetCellTag, L_DispContainerSetCellProperties, L_DispContainerGetCellProperties, L_DispContainerRepositionCell, L_DispContainerGetCellPosition, L_DispContainerGetCellBounds, L_DispContainerFreezeCell, L_DispContainerSelectCell, L_DispContainerIsCellSelected, L_DispContainerIsCellFrozen

Topics:

Image Viewer Cells

 

Image Viewer Functions: Image Viewer Cells

Example

This function removes the specified cell without removing its image list.

 L_INT DispContainerGetCellBitmapListExample(HDISPCONTAINER hCon,
                                                            HBITMAPLIST  * hBitmapList,
                                                            L_INT          nCellIndex)
{
   L_INT nRet;
   L_INT nCount = L_DispContainerGetCellCount (hCon, 0); 

   // Check the validity of the cell index
   if ((nCellIndex < 0) || (nCellIndex >= nCount)) 
      return 0; 

   // retrieve the bitmap list. 
   nRet = L_DispContainerGetCellBitmapList(hCon, nCellIndex, hBitmapList, 0); 
   if(nRet != SUCCESS)
      return nRet;

   // remove the cell
   nRet = L_DispContainerRemoveCell (hCon, nCellIndex, FALSE, 0); 
   if(nRet != SUCCESS)
      return nRet;
   return SUCCESS;
}

L_INT DispContainerImageProcessingExample(HDISPCONTAINER hCon,
                                                         L_INT          nCellIndex)
{
   BITMAPHANDLE Bitmap;
   HBITMAPLIST hBitmapList;

   // Get the bitmap list of the first cell.
   L_INT nRet = L_DispContainerGetCellBitmapList(hCon, 0, &hBitmapList, 0);
   if (nRet != SUCCESS)
      return nRet;

   //Deattach the bitmap list from the contianer inorder to perform some image processing on it.
   nRet = L_DispContainerSetCellBitmapList(hCon, 0, NULL, 0, 0);
   if (nRet != SUCCESS)
      return nRet;

   // get the first bitmap in the bitmap list .
   nRet = L_GetBitmapListItem(hBitmapList, nCellIndex, &Bitmap, sizeof(BITMAPHANDLE));
   if (nRet != SUCCESS)
      return nRet;

   // fill the bitmap will the desiared color.
   nRet = L_MultiScaleEnhancementBitmap(&Bitmap, 2000, 4, MSE_DEFAULT , 0, 0, MSE_GAUSSIAN | MSE_EDGEENH);
   if(nRet !=SUCCESS)
      return nRet;

   // set the bitmap list again.
   nRet = L_SetBitmapListItem(hBitmapList, nCellIndex, &Bitmap);
   nRet = L_DispContainerSetCellBitmapList(hCon, 0, hBitmapList, 0, 0);

   return nRet;
}