Macaw OS C reference

Function parsepicture

#include <macaw.h>
int parsepicture(
    const char **rows,
    int n,
    const char *chars,
    const int *colours
);

Makes a picture from rows of text, one character for each pixel. It's a quick way to draw small things in your code.

Parameters

rowsconst char **
An array of strings, one for each row of pixels, from the top.
nint
How many rows there are.
charsconst char *
The characters you use, in a string, like ".#o". NULL means . is colour 0, and 0-9 and a-v are colours 0 to 31.
coloursconst int *
An array giving the colour for each character in chars, in the same order. Characters not in chars are 0.

Returns int

The picture's number, or 0 if it couldn't be made. It's as wide as the longest row.

In Pictures, with newpicture, loadpicture, freepicture, picturewidth, pictureheight, drawpicture, drawpart, drawinto, drawpictureex, drawpartex, savepicture, decodepicture, decodepicturefile, importpicture, importpicturefile, pictureget, pictureset, picturesize, pictureclear, picturecopy, picturegetrgb, picturesetrgb.