L_INT LImageListControl::Update(pItem, nIndex)
Updates the specified item in the ImageList Control.
Pointer to an LILITEM structure that contains new attributes for the item at the specified index.
0-based index that indicates which item to update.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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.
Win32, x64.
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 Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document