LImageListControl::Update

Summary

Updates the specified item in the ImageList Control.

Syntax

#include "ltwrappr.h"

L_INT LImageListControl::Update(pItem, nIndex)

Parameters

pLILITEM pItem

Pointer to an LILITEM structure that contains new attributes for the item at the specified index.

L_INT nIndex

0-based index that indicates which item to update.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Comments

The LILITEM structure pointed to by pItem specifies the information to with which to update the specified item. The uMask member of the LILITEM structure indicates the attributes of the item to update.

Note: When you update an item, the image and text (if any) are copied to internal storage. The ImageList Control will free its copy of the image and/or text when the item is deleted. You are responsible for freeing the original data when it is no longer needed by your application.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

L_INT LImageListControl__UpdateExample(LImageListControl& ImgList) 
{ 
   L_INT nRet; 
   LILITEM Item; 
   LBitmapBase Bitmap; 
 
   // get the item's image 
   Item.uStructSize = sizeof(LILITEM); 
   Item.uMask = LILITEM_BITMAP; 
 
   nRet = ImgList.GetItem(&Item, 0);// get first item 
   if(nRet != SUCCESS) 
      return nRet; 
 
   // flip the image 
   Bitmap.SetHandle(Item.pBitmap); 
   nRet = Bitmap.Flip(); 
   if(nRet != SUCCESS) 
      return nRet; 
 
   Item.pBitmap = Bitmap.GetHandle(); 
 
   // change the item's image and text 
   Item.pText = TEXT("Flipped Image"); 
   Item.uMask = LILITEM_BITMAP | LILITEM_TEXT ; 
 
   nRet = ImgList.Update(&Item, 0);// update the item 
   if(nRet != SUCCESS) 
      return nRet; 
 
   return SUCCESS; 
} 
Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.