[comp.windows.x] xwps and color maps

burzio@mmlai.UUCP (Tony Burzio) (10/25/89)

How does one use xwps3 to dump a window that has a different
color map asociated with it?  All I can get is a B&W shaded
picture that uses the default color map.  Thanks in advance.

*********************************************************************
Tony Burzio               * Offer union between the US & USSR!
Martin Marietta Labs      * They'd never take it, but it'd shake'em up!
mmlai!burzio@uunet.uu.net *
*********************************************************************

meyer@planck.uucp (Bob Meyer) (10/27/89)

In article <606@mmlai.UUCP> burzio@mmlai.UUCP (Tony Burzio) writes:
>How does one use xwps3 to dump a window that has a different
>color map asociated with it?  All I can get is a B&W shaded
>picture that uses the default color map.  Thanks in advance.
>

'xwps3' (I posted it) is supposed to use the colormap that is used by
the window that it's dumping.  It luminence maps the image using the
RGB values that the window says it is using.  Presumably the call to
'XCreateWindow' set the 'CWcolormap' attribute and stuffed the colormap
into the attributes structure.  I've noticed some applications that
simply trigger on the EnterNotify event and forcibly install their
colormap with 'XInstallColormap' without telling the rest of the world.

This brings up a question that has been bugging me for a while: on a
Sun4 running X11r3 and SunOS 4.0.3 with a CG2 color display, why
doesn't the system recognize changes to the colormap when I try to
change it with 'XChangeWindowAttributes'.  Any calls to
'XGetWindowAttributes' returns the original colormap.  It never
notifies the world that the colormap has been changed.  I'm faking it
out now by simply changing all of the values in the original colormap
(which doesn't change it's actual address) and generating an 'Expose'
event to generate a redraw when I want to change the colormap.  I'm
trying to switch between a falsecolor map and a greyscale.

BTW, I will be posting an update to 'xwps3' soon which will allow the
use of color PostScript printers and is about 2 times faster (thanx
Pekka Kyt (netmgr@csc.fi) for the color code diffs).

Hope this helps... Good Luck...
-- 
   Thinking quickly, the IBM System Jock     # Bob Meyer
uttered an incantation in EBCDIC and made    # Calspan Advanced Tech. Center
the sign of the Terminated Fork.             # ...!sunybcs!planck!meyer
   The UNIX Guru only smiled and trapped him in a recursive SED script.