Available in the LEADTOOLS Imaging toolkit. |
SaveArray example for C++ 4.0 and later
COleVariant MyVar;
long lSize;
HFILE hFile;
void HUGEP* pData=NULL;
m_LEAD1.Load("v:\\images\\babe.cmp", 0, 1, 1);
MyVar.Clear();
MyVar = m_LEAD1.SaveArray(FILE_CMP, 0, 2);
_lcreat("d:\\temp\\test.cmp", 0);
hFile = _lopen("d:\\temp\\test.cmp", OF_READWRITE);
SafeArrayAccessData(MyVar.parray, &pData);
lSize = m_LEAD1.ArraySize(&MyVar);
_lwrite(hFile, (LPCSTR)pData, lSize);
SafeArrayUnaccessData(MyVar.parray);
_lclose(hFile);