Index   Commented   Search   About

Determining a Decompressor's Output Format

The following example determines the buffer size needed for the data specifying the decompression format using the ICDecompressGetFormatSize macro, allocates a buffer of the appropriate size using the GlobalAlloc function, and retrieves the decompression format information using the ICDecompressGetFormat macro.

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);

The following example shows how an application can use the ICDecompressQuery macro to determine if a decompressor can handle the input and output formats.

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.

}

The following code fragment shows how to get the palette information using the ICDecompressGetPalette macro.

ICDecompressGetPalette(hIC, lpbiIn, lpbiOut);

// Move up to the palette.

lpPalette = (LPBYTE)lpbiOut + lpbi->biSize;

Related Links

Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
TMS Scripter Studio Pro components for Delphi/C++Builder

More Online Helps

Win32 Programmer's Reference (win32.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Sockets 2 Reference (sock2.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages

Free Tech Secrets ;) Copyright © 2008 Free Tect Secrets ;) greatis just4fun network just4fun