LBitmapList::RemoveItem

#include "ltwrappr.h"

virtual L_INT LBitmapList::RemoveItem(uIndex, pRemovedBitmap)

Removes a bitmap from the list.

Parameters

L_UINT 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.

LBitmapBase * pRemovedBitmap

Pointer to the bitmap object that references the removed bitmap. You can use this object afterward to work with the individual bitmap.

Returns

Value Meaning
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 bitmap list and free the bitmap, you should use LBitmapList::DeleteItems.

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

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT LBitmapList__RemoveItemExample(HWND hWnd) 
{ 
   L_INT nRet; 
   LBitmapList BitmapList; 
   LBitmapBase Bitmap, PaintBitmap; 
   HDC hDC; 
   RECT rcClientRect; 
 
   // load three images and insert them in the list 
   Bitmap.Load(MAKE_IMAGE_PATH(TEXT("image1.cmp")), 0,ORDER_BGR); 
   BitmapList.Create (); 
   BitmapList.InsertItem (&Bitmap); 
   Bitmap.Load(MAKE_IMAGE_PATH(TEXT("image2.cmp")), 0,ORDER_BGR); 
   BitmapList.InsertItem (&Bitmap); 
   Bitmap.Load(MAKE_IMAGE_PATH(TEXT("ImageProcessingDemo\\Image3.cmp")), 0,ORDER_BGR); 
   BitmapList.InsertItem (&Bitmap); 
 
    // Set the DC and the Destination rectangle 
   GetClientRect(hWnd, &rcClientRect); 
   hDC = GetDC(hWnd); 
   PaintBitmap.Paint()->SetDC(hDC); 
   PaintBitmap.SetDstRect(&rcClientRect); 
 
   // Remove an item and paint the removed item 
   nRet =BitmapList.RemoveItem (2, &PaintBitmap); 
   if(nRet !=SUCCESS) 
      return nRet; 
   PaintBitmap.Paint()->PaintDC(); 
 
   ReleaseDC(hWnd, hDC); 
 
   return SUCCESS; 
} 
Help Version 21.0.2021.4.8
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help