[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: device,decomposed=0
- From: davidf(at)dfanning.com (David Fanning)
- Date: Mon, 8 Feb 1999 11:13:53 -0700
- Newsgroups: comp.lang.idl-pvwave
- Organization: Fanning Software Consulting
- References: <36B9B42C.FA417459@fz-juelich.de> <36B9B51E.54BF13D9@fz-juelich.de> <MPG.firstname.lastname@example.org> <36BEF984.AC8CB729@fz-juelich.de> <MPG.email@example.com> <36BF252C.A08D50C4@fz-juelich.de>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:13587
R.Bauer (R.Bauer@fz-juelich.de) writes:
> David Fanning wrote:
> > R.Bauer (R.Bauer@fz-juelich.de) writes:
> > > Solution is:
> > >
> > > FUNCTION def_n_colors
> > > IF !d.n_colors GT 256 THEN RETURN,256 ELSE RETURN,!d.n_colors
> > > END
> > Well, not exactly. But probably close enough for government work. :-)
> True, but how else could I handle 8Bit color displays accessing only 236
> colors and true color displays with decomposed,0 having 256 colors?
No, you are absolutely right. I'm sure this works for you.
I'm just saying that you cannot depend upon !D.N_Colors
reflecting the *correct* number of colors for all versions of
IDL all the time. And depending upon what you are doing,
you don't really want to know the number of colors anyway.
What you more often want to know is how many color table
elements are available. The system variable !D.Table_Size
is a more accurate value for this purpose.
But, of course, what you *really* want to know is the
type of color visual, the depth of the display, and
whether color decomposition is turned on or off at this
particular moment. All of this information is now available
in IDL 5.2 via keywords to the DEVICE command. If everyone
would just upgrade to IDL 5.2, we would have the color
situation licked. :-)
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: firstname.lastname@example.org
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155