L_ToggleBitmapCompression

#include "l_bitmap.h"

L_INT EXT_FUNCTION 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

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

(Document/Medical only) 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.

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.

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

Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.

See Also

Topics:

Speeding Up 1-Bit Documents

Example

/* This function toggles bitmap compression */
void ToggleCompression(HWND hWnd, pBITMAPHANDLE pBitmap)
{
   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);
      if(L_ToggleBitmapCompression(pBitmap) == 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"));
      MessageBox(hWnd, s, TEXT("ToggleBitmapCompression"), MB_OK);
   }
}