home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / windows / x / 16108 < prev    next >
Encoding:
Text File  |  1992-09-03  |  2.8 KB  |  64 lines

  1. Newsgroups: comp.windows.x
  2. Path: sparky!uunet!das.wang.com!wang!news
  3. From: izeek@techunix.technion.ac.il (Ilan Aisic)
  4. Subject: Re: 256 grayscale levels with standard colormap
  5. Reply-To: izeek@techunix.technion.ac.il (Ilan Aisic)
  6. Organization: Technion, Israel Inst. of Technology
  7. Date: Thu, 3 Sep 1992 19:54:18 GMT
  8. Message-ID: <1992Sep3.195418.6065@discus.technion.ac.il>
  9. References: <1992Sep2.040959.16164@walter.cray.com>
  10. Sender: news@wang.com
  11. Lines: 51
  12.  
  13. In article <1992Sep2.040959.16164@walter.cray.com> vincent@cadillac.cray.com (Vincent LE BARAZER) writes:
  14. >
  15. > Hi everybodyx,
  16. >
  17. > I'd like to create an X application that draw lines of pixels, with
  18. >color level from 0 to 255 in a Grayscale visual.
  19. > This application has to work either on 8 planes grayscale servers or
  20. >on 24 planes color server.
  21. >
  22. > My first step was to Create a new colormap, allocate 256 levels of gray
  23. >pixels ( red = green = blue ), and install this colormap .
  24. >
  25. > ... but other X clients running on the same server do not like this new
  26. >colormap !
  27. >
  28. > So , how can I handle 256 gray levels without changing the color map ?
  29. >I suppose that the Visual type has something to do with this ??....
  30. > ...
  31.  
  32. If you want to use a virtual colormap for your window, you will
  33. get the "colormap flashing" whenever you move your pointer into and out of
  34. your window (in an 8 planes server).  To avoid the "flashing" (when other
  35. windows appear in false colors), it  is recommended that you allocate
  36. from the default colormap. But then, you will not get 256 colors because
  37. some (or many) of the cells are already in use.
  38. If you still cannot get all the colors you need, that is, enough slots,
  39. and you want to minimize the flashing, I suggest the following approach:
  40. 1. Create your own virtual colormap.
  41. 2. If your application only needs grays, assign all the grays
  42.    you need to the upper portion of your colormap.
  43. 3. Leave as many unused colorcells (in your virtual colormap)
  44.    as possible in the beginning of the colormap.
  45. 4. If your application also needs other colors, you may want
  46.    to consider copying the content of the first colorcells
  47.    (as many as possible) from the default colormap into your colormap.
  48. The window manager will continue to switch colormaps,
  49. but the colormap flashing will be reduced or not visible unless you have
  50. some other color demanding applications on the screen.
  51. This is so because the window manager (at least OpenWin), tend
  52. to use the colors at the beginning of the colormap.
  53.  
  54.     ____
  55.      /  /   __
  56.     /  /   /_/ /| /
  57.  __/_ /__ / / / |/   o o o
  58.  
  59.                            Ilan Aisic
  60.            Israel                                 USA
  61. Voice:   972-4-344474                         1-914-644-7710
  62. Fax:     972-4-342492                         1-914-644-7763
  63. E-mail:  izeek@techunix.technion.ac.il        ilan@allink.com
  64.