IGetFrame::SetFormat

The SetFormat method sets the decompressed image format of the frames being extracted and optionally provides a buffer for the decompression operation.

HRESULT SetFormat(
  PAVISTREAM ps,            
  LPBITMAPINFOHEADER lpbi,  
  LPVOID lpBits,            
  int x,                    
  int y,                    
  int dx,                   
  int dy                    
);
 

Parameters

ps
Address of the interface to a stream.
lpbi
Address of a BITMAPINFOHEADER structure defining the decompressed image format. You can also specify NULL or the value ((LPBITMAPINFOHEADER) 1) for this parameter. NULL causes the decompressor to choose a format that is appropriate for editing (normally a 24-bit image depth format). The value ((LPBITMAPINFOHEADER) 1) causes the decompressor to choose a format appropriate for the current display mode.
lpBits
Address of a buffer to contain the decompressed image data. Specify NULL to have this method allocate a buffer.
x and y
The x- and y-coordinates of the destination rectangle within the DIB specified by lpbi. This parameter is used when lpBits is not NULL.
dx and dy
Width and height of the destination rectangle. These parameters are used when lpBits is not NULL.

Return Values

Returns NOERROR if successful, E_OUTOFMEMORY if the decompressed image is larger than the buffer size, or E_FAIL otherwise.

Remarks

The x, y, dx, and dy parameters identify the portion of the bitmap specified by lpbi and lpBits that receives the decompressed image.

For handlers written in C++, SetFormat has the following syntax:

HRESULT SetFormat(LPBITMAPINFOHEADER lpbi, LPVOID lpBits, int x, 
    int y, int dx, int dy); 
 

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in vfw.h.
  Import Library: Use vfw32.lib.

See Also

Custom File and Stream Handlers Overview, Custom File and Stream Handler Interfaces, BITMAPINFOHEADER