[comp.windows.x] Pixmap <-> Bitmap File?

dave@andromeda.rutgers.edu.rutgers.edu (Dave Bloom) (09/07/89)

Here's a quick little question:

I have bitmap data residing in a file that I want to access
at run-time.  I want to convert this data to a Pixmap of
arbitrary depth.  How do?

If I use XReadBitmapFile(), I get a pixmap of depth one, but
how do I convert this to a pixmap of depth >1?  I can't use
the resulting pixmap in a call to XCreatePixmapFromBitmapData()...
so am I missing something?  I DON'T want to have to parse the
bitmap file on my own.

Any suggestions, insights would be appreciated. I'm strictly using
Xlib, so no toolkit suggestion please.  Please respond by email
and I will summarize if there's an interest.

Thanx.
_______________________________________________________________________________
rutgers\                                                 | Dave Bloom
 galaxy >!andromeda!dave -or- dave@andromeda.rutgers.edu | Work: (201)648-5085
pyramid/                                                 |

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (09/07/89)

> I have bitmap data residing in a file that I want to access
> at run-time.  I want to convert this data to a Pixmap of
> arbitrary depth.  How do?

> If I use XReadBitmapFile(), I get a pixmap of depth one, but
> how do I convert this to a pixmap of depth >1?

Create a pixmap of the desired depth, and a GC and then use XCopyPlane() this
will put the foreground color everywhere there is 1 and background color
everywhere there is a 0.  The colors are retreived from the GC.

> I'm strictly using Xlib...

Some people cannot get enough punishment :-)


						Chris D. Peterson     
						MIT X Consortium 

Net:	 kit@expo.lcs.mit.edu
Phone:   (617) 253 - 9608	
Address: MIT - Room NE43-213