Caution: This version of this document is no longer maintained. For the latest documentation, see

PgDrawPhImage(), PgDrawPhImagev(), PgDrawPhImageCx(), PgDrawPhImageCxv()

Draw an image that's contained in a PhImage_t structure


int PgDrawPhImage( PhPoint_t const *pos,
                   PhImage_t const *image,
                   int flags );

int PgDrawPhImagev( PhPoint_t const *pos,
                     PhImage_t const *image,
                     int flags );

int PgDrawPhImageCx( void *dc,
                     PhPoint_t const *pos,
                     PhImage_t const *image,
                     int flags );

int PgDrawPhImageCxv( void *dc,
                      PhPoint_t const *pos,
                      PhImage_t const *image,
                      int flags );




These functions draw the provided image at the position specified in the PhPoint_t structure pointed to by pos. The image parameter must be a pointer to a PhImage_t structure that defines the image to be rendered.

If the image has a transparency mask, it's used. These functions set the palettes for palette-based images, and apply alpha blending if the alpha member of the PhImage_t structure isn't NULL.

You can pass the following bit in the flags argument:

Render the image using the ghost bitmap as a transparency mask.

Note: If you call the “v” forms of this function, the data isn't physically copied into the draw buffer. Instead, a pointer to the image is stored until the draw buffer is flushed. Make sure you call PgFlush() before you modify the image.

If the data is in shared memory, the “v” forms of this function automatically pass a shared memory reference instead of the image.

PgDrawPhImage() and PgDrawPhImagev() work on the current draw context, while you can specify the draw context dc for PgDrawPhImageCx() and PgDrawPhImageCxv().


The draw buffer couldn't be resized enough to fit a single scan line of the image (insufficient memory).



Interrupt handler No
Signal handler No
Thread No

See also:

ApGetImageRes(), PgDrawPhImageRect*v(), PgDrawRepPhImage*(), PgFlush*(), PhCreateImage(), PhImage_t, PhMakeGhostBitmap(), PhMakeTransBitmap(), PhMakeTransparent(), PhPoint_t, PhReleaseImage(), PmMemCreateMC(), PmMemFlush(), PxLoadImage()

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