Seth Woolley's Man Viewer

XReadBF(3) - XCreateBitmapFromData, XCreatePixmapFromBitmapData, XReadBitmapFile, XReadBitmapFileData, XWriteBitmapFile - manipulate bitmaps - man 3 XReadBF

([section] manual, -k keyword, -K [section] search, -f whatis)
man plain no title

XReadBitmapFile(3X11)                                    XReadBitmapFile(3X11)



NAME
       XReadBitmapFile, XReadBitmapFileData, XWriteBitmapFile, XCre-
       atePixmapFromBitmapData, XCreateBitmapFromData - manipulate bitmaps

SYNTAX
       int XReadBitmapFile(Display *display, Drawable d, char *filename,
              unsigned int *width_return, unsigned int *height_return, Pixmap
              *bitmap_return, int *x_hot_return, int *y_hot_return);

       int XReadBitmapFileData(char *filename, unsigned int *width_return,
              unsigned int *height_return, unsigned char *data_return, int
              *x_hot_return, int *y_hot_return);

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

       Pixmap XCreatePixmapFromBitmapData(Display *display, Drawable d, char
              *data, unsigned int width, unsigned int height, unsigned long
              fg, unsigned int bg, unsigned int depth);

       Pixmap XCreateBitmapFromData(Display *display, Drawable d, char *data,
              unsigned int width, unsigned int height);

ARGUMENTS
       bitmap    Specifies the bitmap.

       bitmap_return
                 Returns the bitmap that is created.

       d         Specifies the drawable that indicates the screen.

       data      Specifies the data in(1,8) bitmap format.

       data      Specifies the location of the bitmap data.

       data_return
                 Returns the bitmap data.

       depth     Specifies the depth of the pixmap.

       display   Specifies the connection to the X server.

       fg
       bg        Specify the foreground and background pixel values to use.

       filename  Specifies the file(1,n) name to use.  The format of the file(1,n) name
                 is operating-system dependent.

       width
       height    Specify the width and height.

       width_return
       height_return
                 Return the width and height values of the read(2,n,1 builtins) in(1,8) bitmap
                 file.

       x_hot
       y_hot     Specify where to place the hotspot coordinates (or -1,-1 if(3,n)
                 none are present) in(1,8) the file.

       x_hot_return
       y_hot_return
                 Return the hotspot coordinates.

DESCRIPTION
       The XReadBitmapFile function reads in(1,8) a file(1,n) containing a bitmap.  The
       file(1,n) is parsed in(1,8) the encoding(3,n) of the current locale.  The ability to
       read(2,n,1 builtins) other than the standard format is implementation-dependent.  If
       the file(1,n) cannot be opened, XReadBitmapFile returns BitmapOpenFailed.
       If the file(1,n) 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(1,n) is readable and valid,
       it returns BitmapSuccess.

       XReadBitmapFile returns the bitmap's height and width, as read(2,n,1 builtins) from the
       file(1,n), to width_return and height_return.  It then creates a pixmap of
       the appropriate size, reads the bitmap data from the file(1,n) 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.

       The XReadBitmapFileData function reads in(1,8) a file(1,n) containing a bitmap,
       in(1,8) the same manner as XReadBitmapFile, but returns the data directly
       rather than creating a pixmap in(1,8) the server.  The bitmap data is
       returned in(1,8) data_return; the client must free this storage when fin-
       ished with it by calling XFree.  The status and other return values are
       the same as for XReadBitmapFile.

       The XWriteBitmapFile function writes a bitmap out to a file(1,n) in(1,8) the X
       Version 11 format.  The name used in(1,8) the output file(1,n) is derived from
       the file(1,n) name by deleting the directory prefix.  The file(1,n) is written in(1,8)
       the encoding(3,n) of the current locale.  If the file(1,n) cannot be opened for
       writing, it returns BitmapOpenFailed.  If insufficient memory is allo-
       cated, XWriteBitmapFile returns BitmapNoMemory; otherwise, on no error(8,n),
       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.

       The XCreatePixmapFromBitmapData function creates a pixmap of the given
       depth and then does a bitmap-format XPutImage of the data into it.  The
       depth must be supported by the screen of the specified drawable, or a
       BadMatch error(8,n) results.

       XCreatePixmapFromBitmapData can generate BadAlloc and BadMatch errors.

       The XCreateBitmapFromData function allows you to include in(1,8) your C pro-
       gram (using #include) a bitmap file(1,n) that was written out by
       XWriteBitmapFile (X version(1,3,5) 11 format only) without reading in(1,8) the bit-
       map file.  The following example creates a gray bitmap:

       #include "gray.bitmap"
       Pixmap bitmap;
       bitmap = XCreateBitmapFromData(display, window, gray_bits, gray_width, gray_height);

       If insufficient working storage was allocated, XCreateBitmapFromData
       returns None.  It is your responsibility to free the bitmap using
       XFreePixmap when finished.

       XCreateBitmapFromData can generate a BadAlloc error.

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 ALSO
       XCreatePixmap(3X11), XPutImage(3X11)
       Xlib - C Language X Interface



XLIB FUNCTIONS                  __xorgversion__          XReadBitmapFile(3X11)

References for this manual (incoming links)