Caution: This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs.

PgSetAlphaBlend(), PgSetAlphaBlendCx()

Set the parameters for alpha blending simply

Synopsis:

void PgSetAlphaBlend(
        PgMap_t const * const src_alpha_map,
        unsigned char const src_alpha_value );

void PgSetAlphaBlendCx(
        PhGC_t *gc,
        PgMap_t const * const src_alpha_map,
        unsigned char const src_alpha_value );

Library:

ph

Description:

These functions set the parameters for an alpha-blending operation.

Calling PgSetAlphaBlend*() is equivalent to calling PgSetAlpha*() with Pg_BLEND_SRC_As and Pg_BLEND_DST_1mAs as the source and destination multipliers.

The src_alpha_map argument is a pointer to the alpha map to be used in the blending operation. If this is NULL, the global blending factor, src_alpha_value, is used. For more information about the PgMap_t structure, see PgMap_t.

PgSetAlphaBlend() works on the current graphics context, while you can specify the graphics context gc for PgSetAlphaBlendCx().

Examples:

// Draw a purple rectangle blended (at 25%) over top of
// whatever is under it.

PgSetAlphaBlend(NULL, 0x40);    // 64 /256 = 0.25 or 25%
PgSetFillColor(Pg_PURPLE);
PgAlphaOn();
PgDrawIRect(0,0,99,99,Pg_DRAW_FILL);
PgAlphaOff();
PgFlush();

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PgAlphaOff(), PgAlphaOn(), PgMap_t, PgSetAlpha()

Alpha Blending Support in the Raw Drawing and Animation chapter of the Photon Programmer's Guide