XBM IO

Read and write XBM images.

Summary
XBM IORead and write XBM images.
Functions
gdImageCreateFromXbmgdImageCreateFromXbm is called to load images from X bitmap format files.
gdImageXbmCtx

Functions

gdImageCreateFromXbm

gdImagePtr gdImageCreateFromXbm(FILE *fd)

gdImageCreateFromXbm is called to load images from X bitmap format files.  Invoke gdImageCreateFromXbm with an already opened pointer to a file containing the desired image.  gdImageCreateFromXbm 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 X bitmap format image).  gdImageCreateFromXbm does not close the file.

You can inspect the sx and sy members of the image to determine its size.  The image must eventually be destroyed using gdImageDestroy.

Parameters

fdThe input FILE pointer

Returns

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

Example

gdImagePtr im;
FILE *in;
in = fopen("myxbm.xbm", "rb");
im = gdImageCreateFromXbm(in);
fclose(in);
// ... Use the image ...
gdImageDestroy(im);

gdImageXbmCtx

void gdImageXbmCtx(gdImagePtr image,
char *file_name,
int fg,
gdIOCtx *out)
gdImagePtr gdImageCreateFromXbm(FILE *fd)
gdImageCreateFromXbm is called to load images from X bitmap format files.
void gdImageXbmCtx(gdImagePtr image,
char *file_name,
int fg,
gdIOCtx *out)
The data structure in which gd stores images.
void gdImageDestroy (gdImagePtr im)
gdImageDestroy is used to free the memory associated with an image.
Close