Sets a new bitmap list handle for the bitmap list object.
#include "ltwrappr.h"
L_VOID LBitmapList::SetHandle(hList, pBListInfo=NULL, bFree=TRUE)
The handle to the bitmap list to be set.
Optional pointer to a structure of type BLISTINFO that holds additional information about the passed bitmap list handle.
Flag that indicates whether to destroy the old bitmap list. Possible values are:
Value | Meaning |
---|---|
TRUE | Destroy the old bitmap list. |
FALSE | Do not destroy the old bitmap list. |
None.
Pass FALSE for bFree if the class object is referencing another object's bitmap list.
In this case, the owner of the bitmap list should free it when it is no longer needed.
If an LBitmapList object is referencing another object's bitmap list, you can use this function to set the object's internal handle to NULL so it will not attempt to free the bitmap list when its destructor is called.
Win32, x64.
L_INT LBitmapList__SetHandleExample(HWND )
{
L_INT nRet;
LBitmapList BitmapList, SecondBitmapList;
LBitmapBase Bitmap;
HBITMAPLIST hBitmapList;
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;
nRet =BitmapList.InsertItem (&Bitmap);
if(nRet !=SUCCESS)
return nRet;
// get the internal handle
hBitmapList = BitmapList.GetHandle ();
// this will invalidate the original bitmaplist
// You have to set the handle of the first list to NULL
// so that when the SecondBitmapList is out of scope it will
// destroy the object
BitmapList.SetHandle (NULL, NULL, FALSE);
// Attach the list to the second LBitmapList object
SecondBitmapList.SetHandle (hBitmapList);
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