Microsoft DirectShow 9.0


The VMR9AlphaBitmap structure is used in the VMR-9's IVMRMixerBitmap9 methods when the application is providing a static alpha-blended bitmap to be displayed on the composited video frame.


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



Bitwise combination of flags from the VMR9AlphaBitmapFlags enumeration type.


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+.


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.


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 specifed 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 member.


Specifies the destination rectangle in composition space.


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


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.


Specifies flags from the VMRMixerPrefs enumeration, which control how the VMR mixes the image. The value must be either 0, to indicate no filtering, or a value in the range MixerPref9_BiLinearFiltering to MixerPref9_GaussianQuadFiltering. These flags may not be combined. This structure member is used only if the dwFlags member contains the VMR9AlphaBitmap_FilterMode flag.

The MixerPref_PointFiltering flag is particularly useful for images that contain text and do not need to be stretched prior to mixing.


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. For more information, see the GDI documentation.


Header: Vmr9.h.

See Also