IPictureMixer2::AddImageFromMemory2

From MediaLooks Knowledge Base
Jump to: navigation, search

The AddImageFromMemory2 method of the IPictureMixer2 interface is used to add an image object to the overlay from RAM.

Contents

Syntax

HRESULT AddImageFromMemory2(
            [in] IMAGE_INFO* _pImageInfo,
            [in] DWORD _cbImage,
            [in] BYTE* _pbImage,
            [in] BSTR _bsItemName,
            [in] int _nColorKeyMin,
            [in] int _nColorKeyMax,
            [in,out] SIZE* _pSize,
            [out] int* _pnCookie
);

Parameters

NameDescription
_pImageInfo[in] Pointer to a structure with all the image-related information needed by the overlay filter. For details see description of the IMAGE_INFO structure.
_cbImage[in] Image size.
_pbImage[in] Pointer to the image.
_bsItemName[in] Image size.Item name used only for user data. Can be empty or NULL
_nColorKeyMin[in] Minimum color for transparency, for detailed description see below.
_nColorKeyMax[in] Maximum color for transparency, for detailed description see below.
_pnCookie[out] Cookie of the item.


Return Values

Return code Description
S_OK Success.
E_OUTOFMEMORY Insufficient memory.
E_POINTER Null pointer argument.


Remarks

The _nColorKeyMin and _nColorKeyMax parameters can be interpreted in the following way. If _nColorKeyMin=RGBA(r,g,b,alpha) and _nColorKeyMax=RGBA(R,G,B,ALPHA), then all pixels with a color RGB(r*,g*,b*) such that (r<=r*<=R)&&(g<=g*<=G)&&(b<=b*<=B) will be assigned a transparency value A* (alpha <= A* <= ALPHA).

Personal tools