int XReadBitmapFile(display, d, filename, width_return, height_return, bitmap_return, x_hot_return,
y_hot_return)
Display *display;
Drawable d;
char *filename;
unsigned int *width_return, *height_return;
Pixmap *bitmap_return;
int *x_hot_return, *y_hot_return;
display | Specifies the connection to the X server. |
d | Specifies the drawable that indicates the screen. |
filename | Specifies the file name to use. The format of the file name is operating-system dependent. |
width_return height_return | Return the width and height values of the read in bitmap file. |
bitmap_return | Returns the bitmap that is created. |
x_hot_return y_hot_return | Return the hotspot coordinates. |
XReadBitmapFile() returns the bitmap's height and width, as read from the file, to width_return and height_return. It then creates a pixmap of the appropriate size, reads the bitmap data from the file into the pixmap, and assigns the pixmap to the caller's variable bitmap. The caller must free the bitmap using XFreePixmap() when finished. If name_x_hot and name_y_hot exist, XReadBitmapFile() returns them to x_hot_return and y_hot_return; otherwise, it returns -1,-1.
XReadBitmapFile() can generate BadAlloc , BadDrawable , and BadGC errors.
BadAlloc | The server failed to allocate the requested source or server memory. |
BadDrawable | A value for a Drawable argument does not name a defined Window or Pixmap. |
BadGC | A value for a GContext argument does not name a defined GContext. |