L_CopyBitmapHandle

Summary

Copies one bitmap handle to another. This function copies only the bitmap handle; it does not copy the actual image data.

Syntax

#include "l_bitmap.h"

L_LTKRN_API L_INT L_CopyBitmapHandle(pBitmapDst, pBitmapSrc, uStructSize)

Parameters

pBITMAPHANDLE pBitmapDst

Pointer to the bitmap handle referencing the destination bitmap.

pBITMAPHANDLE pBitmapSrc

Pointer to the bitmap handle referencing the source bitmap to copy.

L_UINT uStructSize

Size in bytes, of the structure pointed to by pBitmapDst, for versioning. Use sizeof(BITMAPHANDLE).

Returns

None.

Comments

The palette referenced by the hPalette field is not duplicated; the hPalette field is copied the same way as other fields in the bitmap handle.

Note that the destination bitmap does not have to be allocated for this function to work. Use L_CopyBitmapData to copy the contents of the image data from one bitmap to another.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

See Also

Functions

Topics

Example

For complete sample code, refer to the FEATURE1 example.
This example loads a temporary bitmap and copies its handle to
the new bitmap. Notice that TmpBitmap is not freed, because the new
bitmap handle references the original image data.

L_INT CopyBitmapHandleExample(pBITMAPHANDLE pBitmap) 
{ 
   L_INT nRet; 
   BITMAPHANDLE TmpBitmap;    /* Bitmap handle for the initial image */ 
   /* Load a bitmap at its own bits per pixel */ 
   nRet = L_LoadBitmap (MAKE_IMAGE_PATH(TEXT("ImageProcessingDemo\\Image3.cmp")), &TmpBitmap, sizeof(BITMAPHANDLE), 0, ORDER_BGR, NULL, NULL); 
   if(nRet != SUCCESS) 
      return nRet; 
   /* Copy bitmap handle to the new bitmap */ 
   if(pBitmap->Flags.Allocated) 
      L_FreeBitmap(pBitmap); 
   nRet = L_CopyBitmapHandle(pBitmap, &TmpBitmap, sizeof(BITMAPHANDLE)); 
   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 API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.