XpmCreateBuffer(3)

NAME
XpmCreateBuffer - create an Xpm-Buffer

SYNOPSIS

int XpmCreateBufferFromImage(Display *display, char **buffer_return, XImage *image, XImage *shapeimage, XpmAttributes *attributes);

int XpmCreateBufferFromPixmap(Display *display, char **buffer_return, Pixmap pixmap, Pixmap shapemask, XpmAttributes *attributes);

int XpmCreateBufferFromXpmImage(char **buffer_return, XpmImage *image, XpmInfo *info);

ARGUMENTS

display
    Specifies the connection to the X server.

buffer_return
    Returns the buffer which is created.

image
    Specifies the image.

shapeimage
    Specifies the shape mask image.

attributes
    Specifies the location of a structure containing information (or NULL).

info
    Specifies the location of a structure to get possible information (or NULL).

DESCRIPTION

  XpmCreateBufferFromPixmap
XpmCreateBufferFromPixmap creates an XPM buffer from a Pixmap. The XpmCreateBufferFromPixmap function works as XpmWriteFileFromPixmap(), it just calls XpmCreateBufferFromImage instead of XpmWriteFileFromImage. Once again, the caller should free the buffer using XpmFree when finished. As a convenience, the XpmReadFileToBuffer and XpmWriteFileFromBuffer functions are provided to copy a file to a buffer and to write a file from a buffer. Thus for instance one may decide to use XpmReadFileToBuffer, XpmCreatePixmapFromBuffer, and XpmFree instead of XpmReadFileToPixmap. On some systems this may lead to a performance improvement, since the parsing will be performed in memory, but it uses more memory.

  XpmCreateBufferFromImage
The XpmCreateBufferFromImage function works as XpmWriteFileFromImage(), it just writes to a malloc’ed buffer instead of to a file. The caller should free the buffer using XpmFree when finished.

  XpmCreateBufferFromXpmImage.
To create an XPM buffer from an XpmImage, use XpmCreateBufferFromXpmImage. The XpmCreateBufferFromXpmImage function writes out the givenimage to a single block malloc’ed buffer inXPM format. If insufficient working storage is allocated, it returns XpmNoMemory, and returns XpmSuccess on success. If the passed XpmInfo structure pointer is not NULL, XpmCreateBufferFromXpmImage looks for the following attributes: XpmComments, XpmExtensions, and XpmHotspot, and writes the related information out as well. The caller should free the buffer using XpmFree when finished.

SEE ALSO
XpmCreateBufferFromImage(3), XpmCreateBufferFromPixmap(3), XpmCreateBufferFromXpmImage(3)