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

PgDrawPhImage(), PgDrawPhImagemx()

Draw an image that's contained in a PhImage_t structure

Synopsis:

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

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

Library:

ph

Description:

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:

Pg_GHOST or Pt_GHOST
Render the image using the ghost bitmap as a transparency mask.

Note: If you call the "mx" form 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 "mx" form of this function automatically passes a shared memory reference instead of the image.


Returns:

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

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

ApGetImageRes(), PgDrawPhImageRectmx(), PgDrawRepPhImage(), PgDrawRepPhImagemx(), 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


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