VMR9AlphaBitmap

 
Microsoft DirectShow 9.0

VMR9AlphaBitmap

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.

Syntax

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

Members

dwFlags

Bitwise combination 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 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.

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

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.

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

Requirements

Header: Vmr9.h.

See Also