L_ReplaceBitmapListItem

#include "l_bitmap.h"

L_LTKRN_API L_INT L_ReplaceBitmapListItem(hList, uIndex, pNewBitmap, pOldBitmap, uStructSize)

HBITMAPLIST hList;

handle to the list of bitmaps

L_UINT uIndex;

position of the bitmap in the list

pBITMAPHANDLE pNewBitmap;

pointer to the new bitmap handle

pBITMAPHANDLE pOldBitmap;

pointer to the old bitmap handle

L_UINT uStructSize;

size in bytes, of the structure pointed to by pBitmap

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.

pNewBitmap

Pointer to the bitmap handle that will replace the existing bitmap handle in the list.

pOldBitmap

Pointer to the bitmap handle that will be updated with the existing bitmap handle from the list.

uStructSize

Size in bytes, of the structure pointed to by pBitmap, for versioning. Use sizeof(BITMAPHANDLE).

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

After calling this function, the bitmap handle in the list references the original image data, not a copy. Therefore, you should not free the bitmap that you pass in, but should instead manage the memory using the related list functions (L_DeleteBitmapListItems and L_DestroyBitmapList).

This function does not free the old 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

Win32, x64, Linux.

See Also

Functions:

L_RemoveBitmapListItem, 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 replaces the 3rd item from the bitmap list.

L_INT ReplaceBitmapListItemExample(HBITMAPLIST hList, BITMAPHANDLE * pNewBitmap) 
{ 
   L_INT nRet; 
   BITMAPHANDLE   OldBitmap;  /* OldBitmap */ 
   /* Replace item #3, and free the old bitmap */ 
   nRet = L_ReplaceBitmapListItem(hList, 3, pNewBitmap, &OldBitmap, sizeof(BITMAPHANDLE)); 
   if(nRet != SUCCESS) 
      return nRet; 
   L_FreeBitmap(&OldBitmap); 
   return SUCCESS; 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Raster Imaging C API Help