diff options
Diffstat (limited to 'src/gdxpm.c')
-rw-r--r-- | src/gdxpm.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/gdxpm.c b/src/gdxpm.c index bad4be3..ae6e336 100644 --- a/src/gdxpm.c +++ b/src/gdxpm.c @@ -28,6 +28,40 @@ BGD_DECLARE(gdImagePtr) gdImageCreateFromXpm(char *filename) #include <X11/xpm.h> +/* + Function: gdImageCreateFromXpm + + <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: + + filename - The 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); + +*/ BGD_DECLARE(gdImagePtr) gdImageCreateFromXpm(char *filename) { XpmInfo info; |