Draw a bitmap
#include <gf/gf.h> int gf_draw_bitmap( gf_context_t context, const uint8_t *image, unsigned stride, unsigned bit0_offset, int x, int y, unsigned w, unsigned h, unsigned flags );
- A handle for the draw context to use.
- A buffer that contains the bitmap data.
- The width of a line of pixel data, in bytes.
- An index into the first byte of the source bitmap. For each scanline of the bitmap that's drawn, this index specifies the bit within the first byte of the scanline's source data that corresponds to the first pixel of the scanline that's drawn.
- x, y
- The coordinates of the pixel offset within the draw surface where the bitmap is drawn.
- w, h
- The width and height of the bitmap, in pixels.
- Flags affecting rendering. One flag is defined:
- GF_DRAW_BITMAP_BACKFILL — render low bits (0) as background color; default is to treat low bits as transparent.
This function draws a bitmap using the given draw context at the position x, y. Bitmaps are simple, one-bit-per-pixel images that are described by a series of bytes, each packing 8 pixels per byte. There may be padding bytes between successive lines. These padding bytes are accounted for in the stride. The bitmap uses the current foreground color as the “on” color (high bits) and the current background color as the “off” color (low bits — if the transparent member in the bitmap structure isn't set).
|This function ignores any ROP and pattern that has been set for the draw context.|
- The hardware isn't locked; check to ensure gf_draw_begin() was called successfully.
QNX Graphics Framework