comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Problem with long integer color when saving a cgwindow to file
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Problem with long integer color when saving a cgwindow to file [message #87894 is a reply to message #87892] Mon, 03 March 2014 09:05 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Mats Löfdahl writes:

> I'm using cgplot in a cgwindow, specifying the color with a long
integer. This works fine. But when I try to save it as a graphics file,
I get an error of this type:
>
> Traceback Report from CGPLOT:
>
> % CGDEFAULTCOLOR: Improper input color. It is possible 24-bit colors (LONGs)
> are being used in indexed color mode to specify colors.
>
>
> Here is a minimal example:
>
> cgwindow
> cgplot, /add, [1, 2, 3], color = 9243623L
> ; Fine so far
> cgcontrol, output = 'test.jpg'

Congratulations, Mats, you are one in 10,000 IDL programmers using long
integers the way they are suppose to be used!

I spent years tying to get people to do this. Eventually, I just gave it
up as a lost cause. As a result, PostScript output is done (by default)
in indexed color mode rather than decomposed color mode. Coyote routines
mostly don't care. But, here is a case where you want to set your
PostScript device up in decomposed color like everything else these
days.

The way this is done is with cgWindow_SetDefs:

cgWindow_SetDefs, PS_Decomposed=1

I have this command in my IDL startup file, so it is done every time I
start an IDL session. This way there is never any difference between
what I see on my display and what I see in my PostScript file. In my
opinion, anyone using IDL 7.1 or later should do this. (24-bit
PostScript was introduced in IDL 7.1).

cgWindow gets its defaults from the keywords you set with
cgWindow_SetDefs.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.idlcoyote.com/
Sepore ma de ni thue. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL_Object example // help with
Next Topic: Codeless Language Module for IDL for BBEdit/TextWrangler

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 15:21:30 PDT 2025

Total time taken to generate the page: 1.12005 seconds