CBaseControlVideo.GetCurrentImage method

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

The GetCurrentImage method retrieves a copy of the current image at the renderer.

Syntax

HRESULT GetCurrentImage(
   long *pBufferSize,
   long *pVideoImage
);

Parameters

pBufferSize

Pointer to the size of the output buffer.

pVideoImage

Pointer to the output buffer for the image.

Return value

Returns an HRESULT value that depends on the implementation; can be one of the following values, or other values not listed.

Return code Description
E_FAIL
Failure.
E_INVALIDARG
Invalid argument.
E_OUTOFMEMORY
Out of memory. Returned when the pVideoInfo parameter is NULL.
NOERROR
Success.
VFW_E_NOT_PAUSED
The operation could not be performed because the filter is not paused.

Remarks

This member function retrieves the image from the sample and copies it into the output buffer. The section of video copied into the output buffer reflects the source rectangle set through the IBasicVideo interface. It does not reflect the destination rectangle.

Requirements

Requirement Value
Header
Ctlutil.h (include Streams.h)
Library
Strmbase.lib (retail builds);
Strmbasd.lib (debug builds)

See also

CBaseControlVideo Class