MFCalculateImageSize function (mfapi.h)

Retrieves the image size, in bytes, for an uncompressed video format.

Syntax

HRESULT MFCalculateImageSize(
  [in]  REFGUID guidSubtype,
  [in]  UINT32  unWidth,
  [in]  UINT32  unHeight,
  [out] UINT32  *pcbImageSize
);

Parameters

[in] guidSubtype

Media subtype for the video format. For a list of subtypes, see Media Type GUIDs.

[in] unWidth

Width of the image, in pixels.

[in] unHeight

Height of the image, in pixels.

[out] pcbImageSize

Receives the size of each frame, in bytes. If the format is compressed or is not recognized, the value is zero.

Return value

The function returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The function succeeded.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header mfapi.h
Library Mfplat.lib
DLL Mfplat.dll

See also

Media Foundation Functions