CBaseControlVideo.GetImageSize 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 GetImageSize method retrieves video image size information.

Syntax

HRESULT GetImageSize(
   VIDEOINFOHEADER *pVideoInfo,
   long            *pBufferSize,
   RECT            *pSourceRect
);

Parameters

pVideoInfo

Pointer to a VIDEOINFOHEADER structure to be filled in.

pBufferSize

Pointer to the size of the video buffer.

pSourceRect

Pointer to the rectangle dimensions of the source video.

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. The data format is not compatible.
E_UNEXPECTED
Unexpected error occurred. One or more arguments are NULL.
NOERROR
Success.

Remarks

This member function is a helper function used for creating memory image renderings of DIB images. It is called from the base class implementation of CBaseControlVideo::GetCurrentImage when a NULLpVideoImage parameter is passed to that member function. As a result, this member function constructs and returns a VIDEOINFOHEADER structure, using the information in pBufferSize and pSourceRect.

Requirements

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

See also

CBaseControlVideo Class