READ_X11_BITMAP procedure reads bitmaps stored in the
X Windows X11 format. The X Windows
program produces a C header file containing the definition of a bitmap produced by that program. This procedure reads such a file and creates an IDL byte array containing the bitmap. It is used primarily to read bitmaps to be used as IDL
widget button labels.
This routine is written in the IDL language. Its source code can be found in the file
subdirectory of the IDL distribution.
File, Bitmap [, X, Y]
A scalar string containing the name of the file containing the bitmap.
A named variable that will contain the bitmap. This variable is returned as a byte array.
A named variable that will contain the width of the bitmap.
A named variable that will contain the height of the bitmap.
Set this keyword to instruct READ_X11_BITMAP to return a 2D array which has one bit per byte (0 for a 0 bit), (255 for a 1 bit) instead.
To open and read the X11 bitmap file named
in the current directory, store the bitmap in the variable
, and the width and height in the variables
READ_X11_BITMAP, 'my.x11', bitmap1, X, Y
To display the new bitmap, enter:
READ_X11_BITMAP, 'my.x11', image, /EXPAND_TO_BYTES
TV, image, /ORDER