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/pgdrawrepbitmap.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/pgdrawrepbitmap.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/pgdrawrepbitmap.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/pgdrawrepbitmap.html on line 9

PgDrawRepBitmap(), PgDrawRepBitmapv(), PgDrawRepBitmapCx(), PgDrawRepBitmapCxv()

Draw a bitmap several times

Synopsis:

int PgDrawRepBitmap( void const *ptr,
                     int flags,
                     PhPoint_t const *pos,
                     PhPoint_t const *size,
                     int bpl,
                     PhPoint_t const *rep,
                     PhPoint_t const *space,
                     long tag );

int PgDrawRepBitmapv( void const *ptr,
                      int flags,
                      PhPoint_t const *pos,
                      PhPoint_t const *size,
                      int bpl,
                      PhPoint_t const *rep,
                      PhPoint_t const *space,
                      long tag );

int PgDrawRepBitmapCx( void *dc,
                       void const *ptr,
                       int flags,
                       PhPoint_t const *pos,
                       PhPoint_t const *size,
                       int bpl,
                       PhPoint_t const *rep,
                       PhPoint_t const *space,
                       long tag );

int PgDrawRepBitmapCxv( void *dc,
                        void const *ptr,
                        int flags,
                        PhPoint_t const *pos,
                        PhPoint_t const *size,
                        int bpl,
                        PhPoint_t const *rep,
                        PhPoint_t const *space,
                        long tag );

Library:

ph

Description:

These functions build a command in the draw buffer to repeatedly draw the bitmap pointed to by ptr. For an explanation of bitmaps, see PgDrawBitmap().

PgDrawRepBitmap() and PgDrawRepBitmapv() work on the current draw context, while you can specify the draw context dc for PgDrawRepBitmapCx() and PgDrawRepBitmapCxv().

These functions:

If you OR flags with Pg_REPBM_ALTERNATE, all the bitmaps are drawn twice; the second time the position is offset by half of space.x and space.y.

The bpl argument indicates the number of bytes per line of image data (that is, the offset from one line of data to the next). To calculate the size of the data transferred to the graphics driver, multiply bpl by size.y. You can determine the size and bpl arguments with the value returned by PxLoadImage().

The data pointed to by ptr is one bit per pixel. If the pixel value is 1, the pixel is drawn with the color set by PgSetTextColor*() or PgSetTextDither*(). If the pixel value is 0, the pixel is drawn as transparent unless you've set flags to Pg_BACK_FILL. With Pg_BACK_FILL, the pixel is drawn with the color set by PgSetFillColor*() or PgSetFillDither*(). The pixels are drawn most significant bit first.

The tag argument is used for data caching by programs such as phrelay (see the QNX Neutrino Utilities Reference). To calculate the tag, use PtCRC(). This argument is ignored if you set it to 0.


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 bitmap is stored until the draw buffer is flushed. Make sure you call PgFlush() before you modify the bitmap.

If the data is in shared memory, the mx form of this function automatically passes a shared memory reference instead of the bitmap.


Returns:

0
Success.
-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.

Examples:

The following example:

DrawRepBitmap() {
    PhPoint_t p = { -32, -32 };
    PhPoint_t rep = { 5, 3 };

    PgSetTextColor( Pg_WHITE );
    PgDrawRepBitmap( TestBitmap, 0, &p,
            &TestBitmapSize, TestBitmapBPL,
            &rep, &TestBitmapSize, 0 );
}

draws:

PgDrawRepBitmap

The following example:

DrawAltRepBitmap() {
    PhPoint_t p = { 0, 0 };
    PhPoint_t rep = { 3, 2 };
    PhPoint_t space;

    space.x = TestBitmapSize.x * 2;
    space.y = TestBitmapSize.y * 2;

    PgSetTextColor( Pg_WHITE );
    PgDrawRepBitmap( TestBitmap, Pg_REPBM_ALTERNATE, &p,
            &TestBitmapSize, TestBitmapBPL,
            &rep, &space, 0 );
}

draws:

PgDrawRepBitmap

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PgDrawBitmap*(), PgDrawRepImage*(), PgFlush*(), PgSetFillColor*(), PgSetFillDither*(), PgSetTextColor*(), PgSetTextDither*(), PhPoint_t, PtCRC(), PxLoadImage()

Drawing attributes and Bitmaps 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/pgdrawrepbitmap.html on line 288

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/pgdrawrepbitmap.html on line 288