✎ NOTE
This function is now obsolete. New applications should use the LBitmapBase::ChangeCompression function.
Toggles the compression of the bitmap.
#include "ltwrappr.h"
virtual L_INT LBitmapBase::ToggleCompression(L_VOID)
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.
(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.
Win32, x64.
L_INT LBitmapBase__ToggleCompressionExample()
{
L_INT nRet;
LBitmapBase LeadBitmap; /* Bitmap handle to hold the loaded image. */
pBITMAPHANDLE pLeadBitmapHandle = LeadBitmap.GetHandle();
/* Load the bitmap, keeping the bits per pixel of the file */
nRet = LeadBitmap.Load(MAKE_IMAGE_PATH(TEXT("OCR1.TIF")), 0, ORDER_BGR);
if(nRet !=SUCCESS)
return nRet;
LeadBitmap.ToggleCompression();
nRet = LeadBitmap.Save (MAKE_IMAGE_PATH(TEXT("Result.BMP")), FILE_BMP, 24, 0, NULL);
if(nRet !=SUCCESS)
return nRet;
//free bitmap
if(pLeadBitmapHandle->Flags.Allocated)
L_FreeBitmap(pLeadBitmapHandle);
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