Macaw OS C reference

Function importpicturefile

#include <macaw.h>
int importpicturefile(
    const char *path,
    int maxw,
    int maxh,
    int *w,
    int *h
);

The same as importpicture, but reads the PNG from a file.

Parameters

pathconst char *
The PNG file's path, from your program's folder unless it starts with /.
maxwint
The widest the picture can be, in pixels, or 0 for 256.
maxhint
The tallest the picture can be, in pixels, or 0 for 256.
wint *
Where to put the PNG's own width: pass the address of an int, like &w, or NULL.
hint *
Where to put the PNG's own height: pass the address of an int, like &h, or NULL.

Returns int

The picture's number, or 0 if the file couldn't be read as a PNG.

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