L_ToggleBitmapCompression

#include "l_bitmap.h"

L_LTKRN_API L_INT L_ToggleBitmapCompression(pBitmap)

Toggles the compression of the specified bitmap.

Parameters

pBITMAPHANDLE pBitmap

Pointer to the bitmap handle.

Returns

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

Comments

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

Platforms

Win32, x64, Linux.

See Also

Topics

Example

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"))); 
      else 
      { 
         wsprintf(s, TEXT("L_ToggleBitmapCompression Failed")); 
         return nRet; 
      } 
      MessageBox(hWnd, s, TEXT("ToggleBitmapCompression"), MB_OK); 
   } 
   return SUCCESS; 
} 

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

LEADTOOLS Raster Imaging C API Help