"Fossies" - the Fresh Open Source Software Archive

Member "libgd-2.3.2/docs/naturaldocs/html/files/gdxpm-c.html" (5 Mar 2021, 12577 Bytes) of package /linux/www/libgd-2.3.2.tar.gz:


Caution: In this restricted "Fossies" environment the current HTML page may not be correctly presentated and may have some non-functional links. You can here alternatively try to browse the pure source code or just view or download the uninterpreted raw source code. If the rendering is insufficient you may try to find and view the page on the project site itself.

XPM Input

Read XPM images.

Summary
XPM InputRead XPM images.
Functions
gdImageCreateFromXpmgdImageCreateFromXbm is called to load images from XPM X Window System color bitmap format files.

Functions

gdImageCreateFromXpm

gdImagePtr gdImageCreateFromXpm(char *filename)

gdImageCreateFromXbm is called to load images from XPM X Window System color bitmap format files.  This function is available only if HAVE_XPM is selected in the Makefile and the Xpm library is linked with the application.  Unlike most gd file functions, the Xpm functions require filenames, not file pointers.  gdImageCreateFromXpm returns a gdImagePtr to the new image, or NULL if unable to load the image (most often because the file is corrupt or does not contain an XPM bitmap format image).  You can inspect the sx and sy members of the image to determine its size.  The image must eventually be destroyed using gdImageDestroy.

Parameters

filenameThe input filename (not FILE pointer)

Returns

A pointer to the new image or NULL if an error occurred.

Example

gdImagePtr im;
FILE *in;
in = fopen("myxpm.xpm", "rb");
im = gdImageCreateFromXpm(in);
fclose(in);
// ... Use the image ...
gdImageDestroy(im);
gdImagePtr gdImageCreateFromXpm(char *filename)
gdImageCreateFromXbm is called to load images from XPM X Window System color bitmap format files.
gdImagePtr gdImageCreateFromXbm(FILE *fd)
gdImageCreateFromXbm is called to load images from X bitmap format files.
The data structure in which gd stores images.
void gdImageDestroy (gdImagePtr im)
gdImageDestroy is used to free the memory associated with an image.
Close