[comp.windows.x] help! pixel madness!

doug@ntvax.uucp (Douglas Scott) (12/08/89)

Help!  I am at my wit's end with regard to pixel values and GC functions!
Over the past year I have been developing an application on a Monochrome
monitor with BlackPixel == 1 and WhitePixel == 0 (Sun 3/280).  I am drawing
waveforms onto a screen that is composed of a window and an associated pixmap
for backing, and I use different GC's to highlight portions, etc.  Up until
now, the program has been working perfectly with regard to fg vs. bg in black
and white.

The problem is:  I want it to be portable to any display style, color or not,
BlackPixel == 1 or not.  I am currently trying to get it to work on a DEC
3100, which has a depth of 8 and has reversed Black and White (0 & 1,
respectively)...at least that is what is says.  I had strange problems
with highlighting...certain things on the screen (scales, etc.) would reverse
properly, and other things (the waveform) would just stay black and
dissappear!  With advice from a friend, I fixed it, but I do not understand
how two foreground figures, both black, can behave differently when
highlighted, given that black and white are both functions of the "1" bit in
the pixel.

My specific problem now is this:  for one set of scale marks, I draw them into
an auxilliary pixmap and then use XCopyPlane() to transfer it into the
backing pixmap, and then flush that to the window (everything else is drawn
onto that backing pixmap and then flushed the same way).  So it looks like
this:

XDrawString --->  aux_pixmap  --(XCopyArea)->  backing pixmap ---> window

and the rest just does this:

XDrawString --->  backing pixmap ---> window

everything done by this second method now works fine, but I am unable to find
a combination of Plane_Masks, fg's, bg's, and GC's to get the stuff that I
have drawn into the aux_pixmap to show up properly in the window.  I either
get a featureless black rectangle (dimensions of the aux_pixmap) or a
featureless white one, or a transparent one, but none of the stuff I draw on
it shows up.  I have tried clearing it first with both fg and bg values, etc.
Mind you, it all works great when Black == 1, etc.  Any suggestions?  Thanks
for reading this whole thing!  Respond either to the Net or via email, thanks!

_________
Douglas Scott
doug@dept.csci.unt.edu