Set the parameters for alpha blending simply
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 );
ph
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().
// 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();
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PgAlphaOff(), PgAlphaOn(), PgMap_t, PgSetAlpha()
“Alpha Blending Support” in the Raw Drawing and Animation chapter of the Photon Programmer's Guide