[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Number of colors of widget appliation



Carsten Dominik (dominik@astro.uva.nl) writes:

> > 1. What version of IDL and on what computer?
> 
> IDL Version 5.2 (hp-ux hp_pa). Research Systems, Inc.
> 
> > 2. If you start IDL up from scratch and type these commands, 
> >    how many colors do you have?
> 
>     Visual Class: PseudoColor (3)
>     Bits Per RGB: 8
>     Physical Color Map Entries (Used / Total): 256 / 256

Yikes! This shouldn't be happening. Do you have some kind of
start-up file that is setting colors for you? Or, more likely,
did you have Netscape running when you started IDL up? You
will have nothing but trouble (Well, you're in for trouble
anyway. See below.) if you don't get a shared color map. So
this is one strike against you. (Oh, sorry, you probably 
don't play baseball in The Netherlands. But this is NOT
good, and if we get to three strikes, you are in BIG trouble!)
 
> > 3. Are you using direct graphics or object graphics?
> 
> Object graphics in general (for the 3 main windows on the 
> widget.  But I display the little image in a forth window 
> (also inside the widget) with a TVSCL command.
> 
> That would be called direct graphics, I guess?

Yep. Bad news. I can see the curve ball coming...
S-t-r-i-i-i-k-e Two!

> > 4. How many colors does your display support?

> 8 bit

Ooogh, strike three! I'm afraid that's it. There is nothing
but bad news ahead.

There are several things going on here that are pretty 
much conspiring against you in a way that I think will
make it impossible for you to be happy with the way your
colors work.

First of all, getting a private color map on an 8-bit
display pretty much guarantees that your colors will
flash no matter what. The window colors will be in the
shared color map and the IDL graphics colors will be
in a private color map, so every time you move the
cursor from a button in your widget program (the
window colors) to the graphics window (the graphics
colors) you will see a flash. I wouldn't be surprised
if you told me the buttons disappeared. :-(

Second, the object graphics system and the direct
graphics system are two completely different and
separate graphics systems. You can get away with 
combining them on a 24-bit display, but you can
almost never get away with it on an 8-bit display.
The reason is, they use colors in a *completely*
different way. So even if you didn't have the
color map problems above, your colors would be
going crazy as you switched focus from an 
object graphics window to a direct graphics 
window.

In general, I think it is safe to say, you really
shouldn't be using the object graphics system on
an 8-bit display unless you have a VERY good reason
to do so. And then you should make sure that the
entire program is written in the object graphics
system. Don't combine the two graphics systems.

But, first, I would try to sort out why you have
a private color map. You really want to get a
shared color map if at all possible. Without
that you are almost finished before you start. :-(

Cheers,

David

-- 
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155