解壓縮資料
[與此頁面相關的功能影片 壓縮管理員是舊版功能。 Microsoft 強烈建議新程式碼不使用此功能。]
下列範例示範應用程式如何使用ICDecompressBegin宏初始化解壓縮程式、使用 ICDecompress 函式解壓縮框架序列,以及使用ICDecompressEnd宏終止解壓縮。
LPBITMAPINFOHEADER lbpiIn, lpbiOut;
LPVOID lpIn, lpOut;
LONG lNumFrames, lFrameNum;
// Assume lpbiIn and lpbiOut are initialized to the input and output
// format and lpIn and lpOut are pointing to the buffers.
if (ICDecompressBegin(hIC, lpbiIn, lpbiOut) == ICERR_OK)
{
for (lFrameNum = 0; lFrameNum < lNumFrames, lFrameNum++)
{
if (ICDecompress(hIC, 0, lpbiIn, lpIn, lpbiOut,
lpOut) == ICERR_OK)
{
// Frame decompressed OK so we can process it as required.
}
else
{
// Handle the decompression error that occurred.
}
}
ICDecompressEnd(hIC);
}
else
{
// Handle the error identifying an unsupported format.
}