4 * X bitmap and image routines.
6 * Copyright (c) 1995 Sun Microsystems, Inc.
8 * See the file "license.terms" for information on usage and redistribution
9 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
18 *----------------------------------------------------------------------
20 * XCreateBitmapFromData --
22 * Construct a single plane pixmap from bitmap data.
24 * NOTE: This procedure has the correct behavior on Windows and
25 * the Macintosh, but not on UNIX. This is probably because the
26 * emulation for XPutImage on those platforms compensates for whatever
30 * Returns a new Pixmap.
33 * Allocates a new bitmap and drawable.
35 *----------------------------------------------------------------------
39 XCreateBitmapFromData(display, d, data, width, height)
50 pix = Tk_GetPixmap(display, d, (int) width, (int) height, 1);
51 gc = XCreateGC(display, pix, 0, NULL);
55 ximage.height = height;
58 ximage.bits_per_pixel = 1;
60 ximage.format = XYBitmap;
61 ximage.data = (char *)data;
62 ximage.byte_order = LSBFirst;
63 ximage.bitmap_unit = 8;
64 ximage.bitmap_bit_order = LSBFirst;
65 ximage.bitmap_pad = 8;
66 ximage.bytes_per_line = (width+7)/8;
68 TkPutImage(NULL, 0, display, pix, gc, &ximage, 0, 0, 0, 0, width, height);