[Previous] [Contents] [Index] [Next]

PgDrawTImage(), PgDrawTImagemx()

Draw an image with a transparency mask

Synopsis:

int PgDrawTImage( void const *ptr,
                  int type,
                  PhPoint_t const *pos,
                  PhDim_t const *size,
                  int bpl,
                  long tag,
                  void const *TransPtr,
                  int TransBPL );

int PgDrawTImagemx( void const *ptr,
                   int type,
                   PhPoint_t const *pos,
                   PhDim_t const *size,
                   int bpl,
                   long tag,
                   void const *TransPtr,
                   int TransBPL );

Description:

These functions build a command in the draw buffer to draw an image with a transparency mask. These functions take the same parameters as PgDrawImage() and PgDrawImagemx() with two additions, TransPtr and TransBPL.


Note: Instead of using this function, we recommend using a PhImage_t structure and calling PgDrawPhImagemx(). To make one of the colors in the image transparent, call PhMakeTransBitmap().

The TransPtr argument points to a bitmap that's TransBPL bytes wide. This defines a bitmap that only allows the image to draw where there's a value of 1 in the bitmap. Any value of 0 in the bitmap prevents the image from drawing. The leftmost pixel corresponds to the top bit of the first byte in the mask.

Returns:

0
Successful completion
-1
The draw buffer is too small to hold the current draw state, the draw command, and one pixel line of the image. Increase the size of the draw buffer or decrease the width of the image.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PgDrawImage(), PhImage_t, PhMakeTransBitmap()


[Previous] [Contents] [Index] [Next]