Compresses of decompresses a bitmap.
#include "l_bitmap.h"
L_LTKRN_API L_INT L_ChangeBitmapCompression(pBitmap, nComp)
Pointer to the bitmap handle referencing the bitmap to compress or decompress.
Flag that indicates the type of compression to use on the bitmap. Possible values are:
Value | Meaning |
---|---|
COMP_NONE | [0] No compression. This option can be used to decompress compressed or super compressed bitmaps. |
COMP_RLE | [1] 1-bit RLE compression. This compression is very fast and Lossless. For more information, refer to Speeding Up 1-Bit Documents. This is the same as passing TYPE_COMPRESSED to L_AllocateBitmap. |
COMP_SUPER | [2] Super compression. This is available for 1-bit, 8-bit, and 24-bit bitmaps only. The 24-bit and 8-bit compression is lossy, while the 1-bit compression is lossless. |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
This function should be used instead of L_ToggleBitmapCompression.
Win32, x64, Linux.
This function toggles bitmap compression.
L_INT ChangeBitmapCompressionExample(HWND hWnd, pBITMAPHANDLE pBitmap)
{
L_INT nRet = 0;
L_TCHAR s[100];
if(pBitmap->BitsPerPixel == 1 || pBitmap->BitsPerPixel == 8 || pBitmap->BitsPerPixel == 24)
{
wsprintf(s, TEXT("BEFORE - ImageSize: %ld bytes, Type: %s"), pBitmap->Size, (pBitmap->Flags.SuperCompressed ? TEXT("SUPERCOMP") : TEXT("UNCOMP")));
MessageBox(hWnd, s, TEXT("ChangeBitmapCompression"), MB_OK);
nRet = L_ChangeBitmapCompression(pBitmap, pBitmap->Flags.SuperCompressed ? COMP_NONE : COMP_SUPER);
if(nRet == SUCCESS)
wsprintf(s, TEXT("AFTER - ImageSize: %ld bytes, Type: %s"), pBitmap->Size, (pBitmap->Flags.SuperCompressed ? TEXT("SUPERCOMP") : TEXT("UNCOMP")));
else
{
wsprintf(s, TEXT("L_ChangeBitmapCompression Failed"));
return nRet;
}
MessageBox(hWnd, s, TEXT("ChangeBitmapCompression"), MB_OK);
}
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.