VMR9AlphaBitmap structure (vmr9.h)

[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 VMR9AlphaBitmap structure is used with the IVMRMixerBitmap9 interface when an application provides a static bitmap for alpha blending with the video frame.

Syntax

typedef struct _VMR9AlphaBitmap {
  DWORD              dwFlags;
  HDC                hdc;
  IDirect3DSurface9  *pDDS;
  RECT               rSrc;
  VMR9NormalizedRect rDest;
  FLOAT              fAlpha;
  COLORREF           clrSrcKey;
  DWORD              dwFilterMode;
} VMR9AlphaBitmap;

Members

dwFlags

Bitwise OR of flags from the VMR9AlphaBitmapFlags enumeration type.

hdc

Handle to the GDI device context (HDC) for the bitmap. If this member contains a non-NULL value, set pDDS to NULL and set the VMR9AlphaBitmap_hDC flag in the dwFlags member. The device context is not compatible with GDI+.

pDDS

Pointer to the IDirect3DSurface9 interface of a Direct3D surface that contains the bitmap. If this member contains a valid pointer, set the hdc member to NULL. The surface format must be D3DFMT_X8R8G8B8 (32-bit RGB) or D3DFMT_A8R8G8B8 (32-bit RGB with per-pixel alpha). The surface must be allocated from the D3DPOOL_SYSTEMMEM pool.

rSrc

Specifies the rectangle to copy from the source image. This rectangle is specified relative to the GDI device context or the DirectDraw surface.

When calling IVMRMixerBitmap9::SetAlphaBitmap, the source rectangle must be valid if a GDI bitmap is specified in the hdc member. On the other hand, if a Direct3D surface is specified in the pDDS member, then you can either set rSrc to a valid rectangle, or use the entire surface by setting the VMR9AlphaBitmap_EntireDDS flag in dwFlags.

When calling IVMRMixerBitmap9::UpdateAlphaBitmapParameters, rSrc is always optional, and is used if dwFlags contains the VMR9AlphaBitmap_SrcRect flag.

rDest

Specifies the destination rectangle in composition space.

fAlpha

Specifies the alpha blending value; must be a value from 0.0 to 1.0 (inclusive).

clrSrcKey

Specifies the source color key. This value is used if the dwFlags member contains the VMR9AlphaBitmap_SrcColorKey. A color key cannot be used with a Direct3D surface that contains per-pixel alpha.

dwFilterMode

One of the following flags from the VMR9MixerPrefs enumeration, or zero to specify no filtering.

Value Meaning
MixerPref9_BiLinearFiltering
0x00000010
Bilinear interpolation filtering.
MixerPref9_PointFiltering
0x00000020
Point filtering.
MixerPref9_AnisotropicFiltering
0x00000040
Anisotropic filtering.
MixerPref9_PyramidalQuadFiltering
0x00000080
Four-sample tent filtering.
MixerPref9_GaussianQuadFiltering
0x00000100
Four-sample Gaussian filtering.
 

This structure member is used only if the dwFlags member contains the VMR9AlphaBitmap_FilterMode flag.

Point filtering is particularly useful for images that contain text and do not need to be stretched prior to mixing.

Remarks

To get the HDC for a GDI bitmap, do the following:

  1. Call GetDC to get the device context for the application's video window.
  2. Call CreateCompatibleDC to create a compatible device context.
  3. Call SelectObject to select the bitmap into the device context obtained in the previous step.
When you are done, release the device context by calling DeleteDC.

Requirements

   
Header vmr9.h

See also

DirectShow Structures