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/pgdrawphimagerect.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/pgdrawphimagerect.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/pgdrawphimagerect.html on line 8

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/pgdrawphimagerect.html on line 8

PgDrawPhImageRectv(), PgDrawPhImageRectCxv()

Draw part of an image that's contained in a PhImage_t structure

Synopsis:

int PgDrawPhImageRectv( PhPoint_t const *pos,
                        PhImage_t const *image,
                        PhRect_t const *rect,
                        int flags );

int PgDrawPhImageRectCxv( void *dc,
                          PhPoint_t const *pos,
                          PhImage_t const *image,
                          PhRect_t const *rect,
                          int flags );

Library:

ph

Description:

These functions draw a rectangular piece (specified by the PhRect_t structure pointed to by rect) of the provided image at position pos. The image parameter must be a pointer to a PhImage_t structure that defines the image to be rendered.

PgDrawPhImageRectv() works on the current draw context, while you can specify the draw context dc for PgDrawPhImageRectCxv().

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.

The currently defined bits for the flags parameter are:

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

The rectangle is clipped to the image boundaries (i.e. the area bounded by (0,0) to (image->size.w - 1, image->size.h - 1). If rect is NULL, the entire image is drawn.

The drawing of the piece of the image begins at pos (i.e. the rect argument doesn't introduce an additional offset.


Note: For image formats where the number of pixels per byte is greater than 1 (e.g. Pg_IMAGE_GRADIENT_NIBBLE, Pg_IMAGE_PALETTE_NIBBLE, Pg_BITMAP_BACKFILL, and Pg_BITMAP_TRANSPARENT), the portion specified by rect might be grown horizontally so that it falls on even byte boundaries.

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(), PgDrawPhImage*(), PgDrawRepPhImage*(), PhCreateImage(), PhImage_t, PhMakeGhostBitmap(), PhMakeTransBitmap(), PhMakeTransparent(), PhPoint_t, PhRect_t, PhReleaseImage(), PmMemCreateMC(), PmMemFlush(), PxLoadImage()

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/pgdrawphimagerect.html on line 185

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/pgdrawphimagerect.html on line 185