[與此頁面相關聯的功能,影片壓縮管理員是舊版功能。 Microsoft強烈建議新程序代碼不使用此功能。]
下列範例會使用 ICDecompressGetFormatSize 巨集來判斷指定解壓縮格式的數據所需的緩衝區大小、使用 GlobalAlloc 函式配置適當大小的緩衝區,並使用 ICDecompressGetFormat 巨集來擷取解壓縮格式資訊。
LPBITMAPINFOHEADER lpbiIn, lpbiOut;
// Assume *lpbiIn points to the input (compressed) format.
dwFormatSize = ICDecompressGetFormatSize(hIC, lpbiIn);
h = GlobalAlloc(GHND, dwFormatSize);
lpbiOut = (LPBITMAPINFOHEADER)GlobalLock(h);
ICDecompressGetFormat(hIC, lpbiIn, lpbiOut);
下列範例示範應用程式如何使用 ICDecompressQuery 巨集來判斷解壓縮程式是否可以處理輸入和輸出格式。
LPBITMAPINFOHEADER lpbiIn, lpbiOut;
// Assume *lpbiIn & *lpbiOut are initialized to the respective
// formats.
if (ICDecompressQuery(hIC, lpbiIn, lpbiOut) == ICERR_OK)
{
// Format is supported - use the decompressor.
}
下列代碼段示範如何使用 ICDecompressGetPalette 巨集取得調色盤資訊。
ICDecompressGetPalette(hIC, lpbiIn, lpbiOut);
// Move up to the palette.
lpPalette = (LPBYTE)lpbiOut + lpbi->biSize;