[comp.windows.x] One more time ... XImage question

madd@world.std.com (jim frost) (02/13/90)

rws@EXPO.LCS.MIT.EDU (Bob Scheifler) writes:
>    The representation on the 4 bit X terminal would be
>    of the upper 4 bits of each 8 bit image byte in my application.
>You can get XPutImage to extract the least significant bits out of 8, but
>you can't really get it to extract the most significant bits.

What you *can* do, and get to behave pretty quickly, is to build a
bitmap for each plane in the image that you want to send across and
then write it to the destination using a plane mask or logical-OR
function.

This has the benefit of working under at least R2, R3, and R4 and will
work regardless of byte ordering (the definition of how to order
things with pixel values of less than one byte in an XImage seems to
be pretty undefined).

I believe xloadimage 1.03 uses this technique to deal with displays of
depths which are not multiples of 8-bits -- if that version does not,
the version I'm working on now will do so and I can send sample code
to anyone interested.

jim frost
saber software
jimf@saber.com