#include "l_bitmap.h"

L_LTKRN_API L_INT L_ToggleBitmapCompression(pBitmap)

Toggles the compression of the specified bitmap.



Pointer to the bitmap handle.


Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.


This function does not support signed data images. It returns the error code ERROR_SIGNED_DATA_NOT_SUPPORTED if a signed data image is passed to this function.

NOTE: This function is now obsolete. New applications should use the L_ChangeBitmapCompression function.

(Document and Medical Imaging toolkits) If the specified bitmap is compressed, calling this function will make the bitmap uncompressed. If the bitmap is uncompressed, calling this function will make the bitmap compressed.

This function only works for 1 bit per pixel images.

Required DLLs and Libraries


Win32, x64, Linux.

See Also



This function toggles bitmap compression.

L_INT ToggleBitmapCompressionExample(HWND  hWnd,pBITMAPHANDLE   pBitmap) 
   L_INT nRet; 
   L_TCHAR   s[100]; 
   if(pBitmap->BitsPerPixel == 1) 
      wsprintf(s, TEXT("BEFORE - ImageSize: %ld bytes, Type: %s"), pBitmap->Size, (pBitmap->Flags.Compressed ? TEXT("COMP") : TEXT("UNCOMP"))); 
      MessageBox(hWnd, s, TEXT("ToggleBitmapCompression"), MB_OK); 
      nRet = L_ToggleBitmapCompression(pBitmap); 
      if( nRet == SUCCESS) 
         wsprintf(s, TEXT("AFTER - ImageSize: %ld bytes, Type: %s"), pBitmap->Size, (pBitmap->Flags.Compressed ? TEXT("COMP") : TEXT("UNCOMP"))); 
         wsprintf(s, TEXT("L_ToggleBitmapCompression Failed")); 
         return nRet; 
      MessageBox(hWnd, s, TEXT("ToggleBitmapCompression"), MB_OK); 
   return SUCCESS; 

Help Version 21.0.2021.4.7
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C API Help