XWriteBitmapFile

Syntax

int XWriteBitmapFile(display, filename, bitmap, width, height, x_hot, y_hot)
      Display *display;
      char *filename;
      Pixmap bitmap;
      unsigned int width, height;
      int x_hot, y_hot;

Arguments

display Specifies the connection to the X server.
filename Specifies the file name to use. The format of the file name is operating-system dependent.
bitmap Specifies the bitmap.
width
height
Specify the width and height.
x_hot
y_hot
Specify where to place the hotspot coordinates (or \-1,\-1 if none are present) in the file.

Description

The XWriteBitmapFile() function writes a bitmap out to a file in the X Version 11 format. The name used in the output file is derived from the file name by deleting the directory prefix. The file is written in the encoding of the current locale. If the file cannot be opened for writing, it returns BitmapOpenFailed. If insufficient memory is allocated, XWriteBitmapFile() returns BitmapNoMemory; otherwise, on no error, it returns BitmapSuccess. If x_hot and y_hot are not -1, -1, XWriteBitmapFile() writes them out as the hotspot coordinates for the bitmap.

XWriteBitmapFile() can generate BadDrawable and BadMatch errors.

Diagnostics

BadDrawable A value for a Drawable argument does not name a defined Window or Pixmap.
BadMatch An InputOnly window is used as a Drawable. BadMatch Some argument or pair of arguments has the correct type and range but fails to match in some other way required by the request.

See also

XCreateBitmapFromData(), XCreatePixmap(), XCreatePixmapFromBitmapData(), XPutImage(), XReadBitmapFile(), "Manipulating Bitmaps".
Christophe Tronche, ch@tronche.com