Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!nstn.ns.ca!news.cs.indiana.edu!know!sdd.hp.com!elroy.jpl.nasa.gov!ames!ucsd!rutgers!dimacs.rutgers.edu!bcm!wilkins.iaims.bcm.tmc.edu!etaylor From: etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) Newsgroups: comp.windows.x Subject: Bitmap Vs. Pixmap Keywords: Bitmap,Pixmap Message-ID: <3703@gazette.bcm.tmc.edu> Date: 22 Jan 91 05:09:29 GMT References: <11627@pt.cs.cmu.edu> Sender: usenet@bcm.tmc.edu Organization: Baylor College of Medicine, Houston, Tx Lines: 50 Nntp-Posting-Host: wilkins.iaims.bcm.tmc.edu There does not seem to be a lot of people outside of mit that REALLY seem to know the difference between bitmaps and pixmaps. I believe that in X10 there actually was a type called "Bitmap" that they merged with Pixmap (probably a bad idea judging from the confusion I have witnessed). Here are the basics : Pixmaps contains COLORS such as blue,green, white, black, etc... Bitmaps contains 1's and 0's. DO NOT confuse 1 and 0 with Black and White. Be very careful with operations that deal with bitmaps. They are usually mapping 1's and 0's to other colors. I. E. There is a BIG difference between : XCreatePixmapFromBitmapData(...,foreground,background,...) ; and XCreateBitmapFromData(....) ; The first operation maps the 1's and 0's to foreground and background respectively. This is a PIXMAP. The second operation returns the raw 1's and 0's in pixmap format. This is a BITMAP. There is a correspondingly big difference between XCopyPlane and XCopyArea. (I am restricting drawables to pixmaps): XCopyArea copies all of its source pixmap to a destination pixmap. XCopyPlane MAPS a BITMAP (usually) to 2 specified colors and puts the result in a Pixmap. When drawing to a BITMAP one must use a GC that has a depth of 1. Frequently, the only way to create such a GC is to use the pixmap as the GC's Drawable parameter. Well, I'm off the Soap Box. -- Eric Taylor Baylor College of Medicine etaylor@wilkins.bcm.tmc.edu (713) 798-3776