IPictureMixer2::AddImage2

From MediaLooks Knowledge Base
Jump to: navigation, search

The AddImage2 method of the IPictureMixer2 interface is used to add an image object to the overlay from a 24 or 32 bits BMP file.

Contents

Syntax

HRESULT AddImage2(
            [in] BSTR _bsImageFileName,
            [in] int _nColorKeyMin,
            [in] int _nColorKeyMax,
            [in,out] SIZE* _pSize,
            [out] int* _pnCookie
);

Parameters

NameDescription
_bsImageFileName[in] Path to the file to add to the overlay.
_nColorKeyMin[in] Minimum color to make transparent. For detailed description see below.
_nColorKeyMax[in] Maximum color to make transparent. For detailed description see below.
_pSize[in] Image size.
_pnCookie[out] Cookie of the item.


Return Values

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


Remarks

After the image is added, you can rescale it by specifying a new value for the _pSize parameter. If _pSize=NULL or it points to zero values, the image keeps its original size. After the call of the method, _pSize points to the size of the image (might be needed for further positioning).
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