Re: PRINTER device changed in IDL 6 [message #38297] |
Mon, 01 March 2004 12:04  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
R.G. Stockwell writes:
> Perhaps (or more likely certainly) I am missing the point, but why load colours inside the
> Printer device? I have always loaded the colors I want before I set the
> set_plot device (usually because I load my very pretty colors in my startup file, and I
> almost never change them). Simply reversing the order of the two calls (tvscl and set_plot)
> makes the error go away.
Well, 16.7 million colors to choose from, some of us are
just not happy with 256, no matter how pretty they are. :-)
No, I'm kidding. This comes up for me because I try
to write programs that are device independent. That is
to say, they work the same way (use the same colors, lay
out their graphics in the same place, align their fonts
in the same way, etc.) no matter what graphics output
device they happen to find themselves running on. In
practice I only care about these: X, WIN, Z, PS, PRINTER.
But even that is challenge enough to cause me to break
out in cold sweats in the middle of the night. (Throw in
MAC and I shake so much I pretty much can't even serve
in tennis.)
But the point is, I try to make these programs self-contained
and smart. In the business I'm in, I can't ever rely on the
environment being set up like mine (or even set up properly
according to my instructions, but that's for another day).
I *have* to load colors inside my programs if I expect them
to work properly. So, as you can see, it's a bit of a problem.
At the moment I am working around this problem by "protecting"
TVLCT commands like this:
IF !D.Name EQ 'PRINTER' THEN BEGIN
Set_Plot, 'Z', /Copy
TVLCT, theColor, theIndex
Set_Plot, 'PRINTER', /Copy
ENDIF ELSE TVLCT, theColor, theIndex
But that seems like a lot of fluff for a single TVLCT command!
Maybe I'll just follow the same path I used when I had to write
25 lines of code every time I wanted to use a TV command, and just
write my own color loading routine. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|