virtual L_INT LBitmapList::GetItem(uIndex, pLBitmap, uStructSize, bReflectIndex=TRUE)
Gets an LBitmapBase object that references a bitmap in the class object's bitmap list.
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.
Pointer to the bitmap object that will reference the bitmap in the list.
Size in bytes, of the structure pointed to by pLBitmap. Use sizeof(BITMAPHANDLE).
Flag that indicates whether to set the current index to the passed index. Possible values are:
Value | Meaning |
---|---|
TRUE | Set the class objects current index to the passed index. |
FALSE | Do not set the class objects current index to the passed index. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
The bitmap handle that this function gets and attaches to the passed LBitmapBase object is a copy of the bitmap handle stored internally in the list. If you modify the bitmap, you can update the class object's internal bitmap handle to reflect the changes by using the LBitmapList::SetItem function.
You should not free the bitmap. Instead, use LBitmapList::DeleteItems.
You cannot use this function to update a bitmap list while it is being used in an animation playback.
Win32, x64.
L_INT LBitmapList__GetItemExample(HWND hWnd)
{
UNREFERENCED_PARAMETER(hWnd);
UNREFERENCED_PARAMETER(hWnd);
L_INT nRet;
LBitmapList BitmapList;
LBitmap Bitmap;
L_INT nCount, i;
nRet =BitmapList.Create ();
if(nRet !=SUCCESS)
return nRet;
// load three images and insert them in the list
nRet =Bitmap.Load(MAKE_IMAGE_PATH(TEXT("image1.cmp")), 0,ORDER_BGR);
if(nRet !=SUCCESS)
return nRet;
nRet =BitmapList.InsertItem (&Bitmap);
if(nRet !=SUCCESS)
return nRet;
nRet =Bitmap.Load(MAKE_IMAGE_PATH(TEXT("image2.cmp")), 0,ORDER_BGR);
if(nRet !=SUCCESS)
return nRet;
nRet =BitmapList.InsertItem (&Bitmap);
if(nRet !=SUCCESS)
return nRet;
nRet =Bitmap.Load(MAKE_IMAGE_PATH(TEXT("ImageProcessingDemo\\Image3.cmp")), 0,ORDER_BGR);
if(nRet !=SUCCESS)
return nRet;
BitmapList.InsertItem (&Bitmap);
nCount = BitmapList.GetItemsCount ();
/* Change the hue of each bitmap in the list,
and restore the transparent color as the last color in the palette */
for (i = 0; i < nCount; ++i)
{
nRet =BitmapList.GetItem (i, &Bitmap, sizeof(BITMAPHANDLE));
if(nRet !=SUCCESS)
return nRet;
nRet =Bitmap.ChangeHue(i * 10);
if(nRet !=SUCCESS)
return nRet;
nRet =BitmapList.SetItem (i, &Bitmap);
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