L_ToggleBitmapCompression

#include "l_bitmap.h"

L_LTKRN_API L_INT L_ToggleBitmapCompression(pBitmap)

pBITMAPHANDLE pBitmap;

/* pointer to the bitmap handle */

Toggles the compression of the specified bitmap.

Parameter

Description

pBitmap

Pointer to the bitmap handle.

Returns

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

LTKRN

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.

Platforms

Win32, x64.

See Also

Topics:

Speeding Up 1-Bit Documents

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;
}