XReadBitmapFile(3X) XLIB FUNCTIONS XReadBitmapFile(3X)NAMEXReadBitmapFile - reads in a file containing a bitmap
SYNTAX
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;
ARGUMENTS
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.
DESCRIPTION
The XReadBitmapFile function reads in a file containing a bitmap. The
file is parsed in the encoding of the current locale. The ability to
read other than the standard format is implementation dependent. If
the file cannot be opened, XReadBitmapFile returns BitmapOpenFailed.
If the file can be opened but does not contain valid bitmap data, it
returns BitmapFileInvalid. If insufficient working storage is allo‐
cated, it returns BitmapNoMemory. If the file is readable and valid,
it returns BitmapSuccess.
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 and BadDrawable errors.
DIAGNOSTICS
BadAlloc The server failed to allocate the requested resource or
server memory.
BadDrawable
A value for a Drawable argument does not name a defined Win‐
dow or Pixmap.
BadMatch An InputOnly window is used as a Drawable.
SEE ALSOXReadBitmapFileData(3X), XWriteBitmapFile(3X), XCreatePixmapFromBitmap‐
Data(3X), XCreateBitmapFromData(3X)X Version 11 Release 6 XReadBitmapFile(3X)