Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ XReadBitmap(3x) — HP-UX ANSI C A.09.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

 

NAME

XReadBitmapFile − read a bitmap from disk. 

Synopsis

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

displaySpecifies a connection to an X server; returned from XOpenDisplay(). 

dSpecifies the drawable. 

filenameSpecifies the filename to use.  The format of the filename is operating system specific. 

width_return

height_returnReturn the dimensions in pixels of the bitmap that is read. 

bitmap_returnReturns the pixmap resource ID that is created. 

x_hot_return

y_hot_returnReturn the hotspot coordinates in the file (or  − 1, − 1 if none present). 

Description

XReadBitmapFile() reads in a file containing a description of a pixmap of depth 1 (a bitmap) in X Version 11 bitmap format.  The file is parsed in the encoding of the current locale.  The ability to read other than the standard format is implementation-dependent.  XReadBitmapFile() creates a pixmap of the appropriate size and reads the bitmap data from the file into the pixmap.  The caller should free the pixmap using XFreePixmap() when finished with it.  If the file cannot be opened, XReadBitmapFile() returns BitmapOpenFailed.  If the file can be opened but does not contain valid bitmap data, XReadBitmapFile() returns BitmapFileInvalid.  If insufficient working storage is allocated, XReadBitmapFile() returns BitmapNoMemory.  If the file is readable and valid, XReadBitmapFile() returns BitmapSuccess. 
Here is an example X Version 11 _returnbitmap file:

#define name_width_return 16
#define name_height_return 16
#define name_x_hot_return 8
#define name_y_hot_return 8
static char name_bits[] = {
  0xf8, 0x1f, 0xe3, 0xc7, 0xcf, 0xf3, 0x9f, 0xf9, 0xbf, 0xfd, 0x33, 0xcc,
  0x7f, 0xfe, 0x7f, 0xfe, 0x7e, 0x7e, 0x7f, 0xfe, 0x37, 0xec, 0xbb, 0xdd,
  0x9c, 0x39, 0xcf, 0xf3, 0xe3, 0xc7, 0xf8, 0x1f};

For more information, see Volume One, Chapter 6, Drawing Graphics and Text. 

Errors

BadDrawable
BadMatch

See Also

XCreateBitmapFromData(), XCreatePixmap(), XCreatePixmapFromBitmapData(), XFreePixmap(), XQueryBestSize(), XQueryBestStipple(), XQueryBestTile(), XSetTile(), XSetWindowBackgroundPixmap(), XSetWindowBorderPixmap(), XWriteBitmapFile(). 

Copyright O’Reilly & Assoc.  —  

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026