Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!sri-unix!sri-spam!mordor!lll-tis!ames!ucbcad!ucbvax!ZERMATT.LCS.MIT.EDU!RWS From: RWS@ZERMATT.LCS.MIT.EDU (Robert Scheifler) Newsgroups: comp.windows.x Subject: bitmaps and backgrounds Message-ID: <871021150448.4.RWS@KILLINGTON.LCS.MIT.EDU> Date: Wed, 21-Oct-87 15:04:00 EDT Article-I.D.: KILLINGT.871021150448.4.RWS Posted: Wed Oct 21 15:04:00 1987 Date-Received: Sat, 24-Oct-87 09:21:02 EDT References: <885@godot.radonc.unc.edu> Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 24 Date: 21 Oct 87 13:51:50 GMT From: godot!sherouse@mcnc.org (George W. Sherouse) In my fix to XMenu I used a loop over planes to XCopyPlane from the bitmap to the pixmap. I am still not convinced that that is the best way to expand a bitmap It certainly isn't. One of the uses of CopyPlane is to fill a pixmap from a bitmap in a single operation. Perhaps the "exactly one plane" sentence in the Xlib manual confused you. The bit-plane you specify is the source bit-plane, not the destination bit-plane. (For a bitmap there is only one plane to choose from, but CopyPlane is more general in allowing you to select an arbitrary bit-plane from a multi-bit source.) If you have a bitmap, and you want to fill a pixmap with a two-color image of it, set the foreground/background in a GC to those two colors, set the plane-mask to all ones, the function to Copy, and do a CopyPlane with a bit-plane of 1. No muss, no fuss. (Alternatively you chould store the bitmap as the stipple of the GC and use fill-style OpaqueStippled in a FillRectangle, but that's more work. Also alternatively you could do a PutImage with format XYBitmap directly into the pixmap, rather than creating the bitmap resource in between. It probably would be nice if Xlib had an XCreatePixmapFromBitmapData to simplify this.)