Freigeben über


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

Pointer to the interface to a stream.

lpbi

Pointer to 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

Pointer to a buffer to contain the decompressed image data. Specify NULL to have this method allocate a buffer.

x

The x-coordinate of the destination rectangle within the DIB specified by lpbi. This parameter is used when lpBits is not NULL.

y

The y-coordinate of the destination rectangle within the DIB specified by lpbi. This parameter is used when lpBits is not NULL.

dx

Width of the destination rectangle. This parameter is used when lpBits is not NULL.

dy

Height of the destination rectangle. This parameter is 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); 
 

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

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