draw an image
int my_image( int x, int y,
int h, int w,
char *image, int bpl,
int xoff, int yoff,
int type, int palsize,
unsigned long *palette, char *palmap,
int transp_bpl, char *transp_bits );
This function draws an image.
The arguments are:
- x, y
- The location at which to draw the image.
These are source coordinates, and need to be converted to printer
coordinates.
If printing is done in landscape mode, you'll need to swap the
x and y coordinates.
- h, w
- The height and width of the image, in source coordinates.
- image
- A pointer to the image.
- bpl
- The number of bytes per line.
- xoff, yoff
- Offsets into the image. This can be used to display part of the
image, such as the lower-right corner of an image that's larger
than the screen.
- type
- The type of image:
- Pg_IMAGE_DIRECT_565
- Pg_IMAGE_DIRECT_888
- Pg_IMAGE_PALETTE_BYTE
- Pg_IMAGE_PALETTE_NIBBLE
For palette-based images, the palette is passed to this function.
When rendering into a RAM buffer, the type of the destination
image is determined by
the imagetype member of the _doc_ctrl
structure. The possible types are:
- Pg_IMAGE_PALETTE_BYTE
- Pg_IMAGE_DIRECT_888
- palsize
- The size of the palette.
- palette
- A pointer to the palette.
- palmap
- An array that defines a mapping for palette indexes. This
array lets you optimize the copying of one palette-based image to
another:
dest_color = palmap[source_color];
- transp_bpl
- The number of bytes per line for the transparency array.
- transp_bits
- Transparency pattern defined for the current draw.
This is an array of 8 characters that defines
an 8-bit * 8-bit pattern (transp_bits[0] defines the
first row of bits, transp_bits[1] the second, and so on).
- 1
- Success.
- 0
- The operation couldn't be done.
Photon
Safety: | |
Interrupt handler |
Not applicable |
Signal handler |
Not applicable |
Thread |
Not applicable |