Creating Read/Write Color Cells - Another Question

This forum is read only. No new submissions are accepted.

Questions about motif? Contact us

2 posts / 0 new
Last post
Creating Read/Write Color Cells - Another Question

Submitted by blawrence1 on Fri, 03/28/2003 - 21:17.

Referring to our last question under the thread Creating Read/Write Color Cells and the response from ICS Support, we are using a Direct Color visual on our Linux System. We were under the impression from our X/Motif books that it is possible to allocate color cells on Direct Color Visuals just like it can be done on Pseudo color visuals. Is this true?

We do not have access to a Pseudo color visual on our Linux system. Is there a way that we can install such a visual or does this depend on the system hardware? The ability to allocate color cells would be a great advantage to the application we are working on.

Thank you in advance for your help!

Bryon Lawrence

Sat, 03/29/2003 - 09:31#1

Sat, 03/29/2003 - 09:31#1

ICS_support

Creating Read/Write Color Cells - Another Question

Well, you have some nice, expensive hardware, and you should be able to use it.

You should be able to create your own colormap with DirectColor visuals. It is TrueColor which pre-defines colormaps and doesn`t allow them to be changed.

(By the way, a good reference for this material is one of the first X books published -- "Introduction to the X Window System" by Oliver Jones. It was put out before Xt and Motif came along, so it is heavy on Xlib fundamentals.)

I`d suggest this strategy Use XMatchVisualInfo. If the PseudoColor is there, as it seems to be for the HP display, use it with XAllocColorCells. Otherwise, use DirectColor of the appropriate depth, and use XAllocColorPlanes, which is more suitable for the multiple RGB sets of DirectColor. The differences are hidden from you by Xlib; you can still call XStoreColor to load the map.