[NTLUG:Discuss] Colors in X
Steve Baker
sjbaker1 at airmail.net
Fri Jan 10 21:07:44 CST 2003
xiao li wrote:
>
> In this program, the white color is toggled to black, black color to
> white, and all other colors to black. I just change the colormap, then
> call XStoreColors() and XFlush(). Let X server to redraw the color. This
> program runs correctly on Solaris or Windows NT if there is a X server
> installed.
>
> This method has a limitation. You can't use more than 256 colors( if you
> know a way can get rid of this limitation, please tell me!! ). I am
> running this program on Redhat 7.1 and 7.3 Linux locally. But if I run
> this program on Linux machine but use xhost to display it on other
> platform, then it can work fine. So I guess it is because of the X
> server. Do I need to change or update the redhat x server?? Or how can I
> configure it to make it works with my blink function??
I don't think you can assume the existance of a colour map in X. Certainly
there isn't one when the display is in 24 or 32 bit modes - just think how
big the table would have to be!
So - I *suspect* you are somehow getting a display mode that doesn't have
a colour table.
However, I'm not an X guru - so this could easily be complete nonsense.
At any rate - in this modern age where graphics adaptors can generally
manage 24 bits per pixel quite easily - it would be a bad idea to assume
that there is some hardware colour table there to be tweaked. It's
quite likely that the underlying driver is EMULATING a colour table
by re-rendering the image from scratch or something.
I think you should just redraw the parts of the image you want to
blink. That's likely to be more efficient on modern graphics
hardware - and it's sure as heck more portable.
---------------------------- Steve Baker -------------------------
HomeEmail: <sjbaker1 at airmail.net> WorkEmail: <sjbaker at link.com>
HomePage : http://www.sjbaker.org
Projects : http://plib.sf.net http://tuxaqfh.sf.net
http://tuxkart.sf.net http://prettypoly.sf.net
More information about the Discuss
mailing list