ICImageCompress function (vfw.h)

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

Syntax

HANDLE VFWAPI 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 value

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

Remarks

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

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header vfw.h
Library Vfw32.lib
DLL Msvfw32.dll

See also

Video Compression Functions

Video Compression Manager