Partager via


IVMRWindowlessControl9::GetCurrentImage

 
Microsoft DirectShow 9.0

IVMRWindowlessControl9::GetCurrentImage

The GetCurrentImage method retrieves a copy of the current image being displayed by the VMR.

Syntax

  HRESULT GetCurrentImage(
  BYTE**  lpDib
);

Parameters

lpDib

[out]  Address of a pointer to a BYTE that will receive the DIB.

Return Values

The method returns an HRESULT. Possible values include those in the following table.

Value Description
S_OK The method succeeded.
VFW_E_WRONG_STATE The VMR is not in windowless mode.

Remarks

This method returns the current image being displayed. The image is returned in the form of packed Windows DIB. The image starts with a BITMAPINFOHEADER structure, possibly including palette entries and/or color masks, followed by the image data.

The VMR allocates the memory for the image and returns a pointer to it in the lpDib variable. The caller must free the memory by calling CoTaskMemFree.

This method can be called at any time, no matter what state the filter is in, whether running, stopped or paused. However, frequent calls to this method will degrade video playback performance.

Example Code

  

Requirements

Header: Include D3d9.h, Vmr9.h.

Library: Use Strmiids.lib.

See Also