etaylor@wilkins.iaims.bcm.tmc.edu (Eric Taylor) (01/22/91)
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
kgg@zinn.MV.COM (Kenn Goutal) (01/28/91)
Well, that was a timely little introduction.
I had just come to wonder about this difference myself on Friday.
I wonder, though, if you (or someone) could expand on the difference
from a "user's" point of view. For example, I know how to use the
'bitmap' program to create and edit bitmaps, and I know how to use
'atobm' and 'bmtoa' to import and export them; but it gets hard to
understand when I go to use them with, say, xbiff and there is a
resource "XBiff*fullPixmap" that seems quite happy with just a *bitmap*.
I would *like* to give it a real pixmap, in the sense of being able
to provide more than -fg and -bg color, but have as yet found no
reference to a pixmap editor.
-- Kenn Goutal
CompuServe: 71117.2572 (PARTI handle: kenn)
Internet: kenn@zinn.MV.COM or kenn@rr.MV.COM
[The] PO!NT: kenn
UUCP: ...decvax!zinn!kenn or ...decvax!zinn!rr!kenn
+-----------------------------------------------------------+
| Ship and Travel Intermodally -- Commute Electronically! |
+-----------------------------------------------------------+