Available in the LEADTOOLS Imaging toolkit. |
RawSave example for C++ 4.0 and later
//This example saves a LEAD BITMAPHANDLE as RAW data starting at offset uOffset.
//The data is padded so that each line of bytes is evenly divided by 4.
//The bits in each byte are reversed before saving.
//The bits per pixel of the raw data is the same as the bits per pixel LEAD1.
//If LEAD1 is a palettized image, the palette is not saved--only the raw data.
void CRawDlg::RawSave(char * pszFileName, unsigned long uOffset)
{
int nRet;
char szMsg[200];
m_Lead.SetSaveLSB(TRUE);
m_Lead.SetSavePad4(TRUE);
nRet = m_Lead.SaveOffset(pszFileName, uOffset, FILE_RAW, 0, 0, 0);
if (nRet == 0)
wsprintf(szMsg, "SUCCESS file save: %s Size[%d]", pszFileName, m_Lead.GetFileSizeWritten());
else
wsprintf(szMsg, "FAILED file save: %s", pszFileName);
AfxMessageBox(szMsg);
}