Available in the LEADTOOLS Imaging toolkit. |
BitmapCompression example for C++ 4.0 and later
// This example toggles the bitmap’s compression
long oldSize;
oldSize = m_Lead1.GetBitmapSize();
if(m_Lead1.GetBitmapCompression() == COMP_NONE)
{
if(m_Lead1.GetBitmapBits () == 24)
m_Lead1.SetBitmapCompression(COMP_SUPER);
else if(m_Lead1.GetBitmapBits () == 1)
m_Lead1.SetBitmapCompression(COMP_RLE);
}
else
m_Lead1.SetBitmapCompression(COMP_NONE);
CString szMsg;
szMsg.Format(“Old Size = %d\rNew Size = %d”, oldSize, m_Lead1.GetBitmapSize());
MessageBox(szMsg);