ICImageCompress

The ICImageCompress function compresses an image to a given size. This function does not require initialization functions.

HANDLE ICImageCompress(
  HIC hic,              
  UINT uiFlags,         
  LPBITMAPINFO lpbiIn,  
  LPVOID lpBits,        
  LPBITMAPINFO lpbiOut, 
  LONG lQuality,        
  LONG * plSize         
);

Parameters

hic

Handle to a compressor opened with the ICOpen function. Specify NULL to have VCM select an appropriate compressor for the compression format. An application can have the user select the compressor by using the ICCompressorChoose function, which opens the selected compressor and returns a handle of the compressor in this parameter.

uiFlags

Reserved; must be zero.

lpbiIn

Pointer to the BITMAPINFO structure containing the input data format.

lpBits

Pointer to input data bits to compress. The data bits exclude header and format information.

lpbiOut

Pointer to the BITMAPINFO structure containing the compressed output format. Specify NULL to have the compressor use an appropriate format.

lQuality

Quality value used by the compressor. Values range from 0 to 10,000.

plSize

Maximum size desired for the compressed image. The compressor might not be able to compress the data to fit within this size. When the function returns, this parameter points to the size of the compressed image. Image sizes are specified in bytes.

Return Values

Returns a handle to a compressed DIB. The image data follows the format header.

Remarks

To obtain the format information from the LPBITMAPINFOHEADER structure, use the GlobalLock function to lock the data. Use the GlobalFree function to free the DIB when you are finished.

Requirements

**  Windows NT/2000/XP:** Included in Windows NT 3.1 and later.
**  Windows 95/98/Me:** Included in Windows 95 and later.
**  Header:** Declared in Vfw.h.
**  Library:** Use Vfw32.lib.

See Also

Video Compression Manager, Video Compression Functions, ICOpen, ICCompressorChoose, BITMAPINFO, GlobalLock, GlobalFree