Bagikan melalui


IVMRWindowlessControl::GetCurrentImage

 
Microsoft DirectShow 9.0

IVMRWindowlessControl::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 array.

Return Values

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Error Code Description
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: Declared in Strmif.h; include Dshow.h.

Library: Use Strmiids.lib.

See Also