L_RemoveBitmapListItem

#include "l_bitmap.h"

L_LTKRN_API L_INT L_RemoveBitmapListItem(hList, uIndex, pBitmap)

HBITMAPLIST hList;

/* handle to the list of bitmaps */

L_UINT uIndex;

/* position of the bitmap in the list */

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Removes a bitmap from the list, and lets you treat it as an individual bitmap.

Parameter

Description

hList

Handle to the list of bitmaps.

uIndex

Position of the bitmap in the list. Use zero-based indexing. For example, if there are 10 bitmaps in a list, the index of the last one is 9. When you remove a bitmap from a list, the indexes of other bitmaps change to accommodate the removal.

pBitmap

Pointer to the bitmap handle that you can use afterward to work with the individual bitmap.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

This function does not free the bitmap. If you want to remove a bitmap from a list and free the bitmap, you should use L_DeleteBitmapListItems.

You cannot use this function to update a bitmap list while it is being used in an animation playback.

Required DLLs and Libraries

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Windows 2000 / XP/Vista, Windows CE.

See Also

Functions:

L_LoadBitmapList, L_SaveBitmapList, L_CreateBitmapList, L_DestroyBitmapList, L_CopyBitmapListItems, L_GetBitmapListCount, L_InsertBitmapListItem, L_DeleteBitmapListItems, L_GetBitmapListItem, L_SetBitmapListItem, L_ColorResBitmapList, L_TranslateBitmapColor

Topics:

Raster Image Functions: Playing Animated Images

 

Implementing Animation

Example

This example removes even numbered bitmaps from a list and deletes them.

 L_INT RemoveBitmapListItemExample(HBITMAPLIST hList)
{
   L_INT nRet;
   BITMAPHANDLE   TmpBitmap;  /* Temporary bitmap for manipulating the list */
   L_UINT         i;          /* Loop counter */
   L_UINT         uCount;     /* Number of bitmaps in the list */

   /* Remove even numbered bitmaps from the list and delete them */
   nRet = L_GetBitmapListCount(hList, &uCount);
   if(nRet != SUCCESS)
      return nRet;
   for (i = 0; i <= uCount; i += 2)
   {
      nRet = L_RemoveBitmapListItem(hList, i, &TmpBitmap);
      L_FreeBitmap(&TmpBitmap);
   }
      
   return SUCCESS;
}