#include "l_bitmap.h"
L_LTKRN_API L_INT L_MoveBitmapListItems(phList, hList, uIndex, uCount)
Creates a new bitmap list by moving the specified bitmaps from an existing list. Bitmap handles and image data are moved.
Address of the variable to be updated with the new list of bitmaps.
Handle to the list of bitmaps to copy from.
Index of the first bitmap to copy.
Number of bitmaps to copy. You can specify (L_UINT) -1 to copy to the end of the existing list.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
The specified items are removed from hList
and moved to the variable pointed to by phList
.
Required DLLs and Libraries
Win32, x64, Linux.
This example moves all but the first two bitmaps in a list of bitmaps; then calls another function to save the moved list.
This example saves a list of 8-bit bitmaps as an animated GIF file.
L_INT SaveBitmapList(HBITMAPLIST hList,pBITMAPHANDLE pLeadBitmap)
{
L_INT nRet;
BITMAPHANDLE TmpBitmap; /* Temporary bitmap handle */
SAVEFILEOPTION SaveFileOption; /* File options when saving */
/* Get a copy of the first image's bitmap handle */
nRet = L_GetBitmapListItem(hList, 0, &TmpBitmap, sizeof(BITMAPHANDLE));
if(nRet != SUCCESS)
return nRet;
/* Get the default SAVEFILEOPTION values */
nRet = L_GetDefaultSaveFileOption(&SaveFileOption, sizeof(SAVEFILEOPTION));
if(nRet != SUCCESS)
return nRet;
/* Use the target bitmap's palette as the global palette */
if(pLeadBitmap->BitsPerPixel<=8)
{
nRet = L_GetBitmapColors(pLeadBitmap, 0, 256, SaveFileOption.GlobalPalette);
if(nRet != SUCCESS)
return nRet;
}
/* Assign the other SAVEFILEOPTION fields */
SaveFileOption.Flags = ESO_GLOBALBACKGROUND|ESO_GLOBALPALETTE;
SaveFileOption.GlobalWidth = TmpBitmap.Width;
SaveFileOption.GlobalHeight = TmpBitmap.Height;
SaveFileOption.GlobalLoop = 0;
SaveFileOption.GlobalBackground = pLeadBitmap->Background;
/* Save the bitmap list as an animated GIF file */
nRet = L_SaveBitmapList(MAKE_IMAGE_PATH(TEXT("testan.gif")), hList, FILE_GIF, 8, 0, &SaveFileOption);
if(nRet != SUCCESS)
return nRet;
return SUCCESS;
}
L_INT MoveBitmapListItemsExample(pBITMAPHANDLE pBitmap, HBITMAPLIST hList)
{
L_INT nRet;
HBITMAPLIST hNewList;
/* Move all but the first two bitmaps of the incoming list */
nRet = L_MoveBitmapListItems(&hNewList, hList, 2, (L_UINT) -1);
if(nRet != SUCCESS)
return nRet;
/* Call a local function to save the new list */
nRet = SaveBitmapList(hNewList, pBitmap);
if(nRet != SUCCESS)
return nRet;
L_DestroyBitmapList(hNewList);
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