Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pg/pgdrawtimage.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pg/pgdrawtimage.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pg/pgdrawtimage.html on line 9

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pg/pgdrawtimage.html on line 9

PgDrawTImage(), PgDrawTImagev(), PgDrawTImageCx(), PgDrawTImageCxv()

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 PgDrawTImagev( void const *ptr,
                   int type,
                   PhPoint_t const *pos,
                   PhDim_t const *size,
                   int bpl,
                   long tag,
                   void const *TransPtr,
                   int TransBPL );

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

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

Library:

ph

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*() with two additions, TransPtr and TransBPL.


Note: Instead of using these functions, we recommend using a PhImage_t structure and calling a PgDrawPhImage*() function. These functions automatically handle palettes, transparency, and so on.

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.

PgDrawTImage() and PgDrawTImagev() work on the current draw context, while you can specify the draw context dc for PgDrawTImageCx() and PgDrawTImageCxv().

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*(), PgDrawPhImage*(), PgDrawRepPhImage*(), PhDim_t, PhImage_t, PhMakeTransBitmap(), PhMakeTransparent(), PhPoint_t

Images in the Raw Drawing and Animation chapter of the Photon Programmer's Guide


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pg/pgdrawtimage.html on line 178

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pg/pgdrawtimage.html on line 178