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

Re: Window Background



David,


    Well in that case I may have a problem...

>From the windows command line I tried:

IDL>  r = [ 255,  68,  87,  58,   0,   0,   0,   0,   0,   0, 8, 93, 169,
255, 255, 255, 255, 0]
IDL> g = [ 255,   0,   0,   0,   8,  97, 182, 255, 255, 255, 255, 255, 255,
255, 170,  80,   0,   0]
IDL> b = [ 255,  72, 145, 218, 255, 255, 255, 242, 165,  80,0,   0,   0,
0,   0,   0,   0,   0]
IDL> tvlct, r, g, b
IDL> !P.Background = 0
IDL> window

And I get a window with a black background.  I'm using IDL 5.2 under NT.

I am actually able to work around this ok by using the fix posted by
Med (Thanks)

erase,color='ffffff'x

And I suppose with a comment in the code I'll even know what's 6 months from
now :).

I did notice that my Windows IDL is 5.2 and 5.3 under Linux.  Anyway I'm
mainly posting this to document a solution for
other who might read the group.

Thanks,

BTW:  Looking forward to the new book. I'm sure direct graphics solves all
these problems :).


"David Fanning" <davidf@dfanning.com> wrote in message
MPG.14706c829a8b0a16989c6c@news.frii.com">news:MPG.14706c829a8b0a16989c6c@news.frii.com...
> Eric Kihn (ekihn@ngdc.noaa.gov) writes:
>
> > Since I got such a great response to my last post I thought I'd try one=
> > =20
> > more time.  Thanks to JD I got the code running but now the=20
> > behaviour on Windows and Linux is different. On the Linux side my
plot=20
> > window comes up with a white background, on the Windows side a black
one=
> > .
> > Same code and version of IDL 5.3.  Since I need the white BG I tried=20
> > !P.BACKGROUND =3D 255 on windows but no change.
>
> What you really should be doing here is setting the background
> color value to the index of the white color in the color
> vectors you are using. You loaded a white color into index
> 0. So your code should look like this:
>
>   TVLCT, r, g, b
>   !P.Background = 0
>
> *Then* if you don't get what you are looking for,
> you might have other problems.
>
> I tend to prefer to ask for colors by name. I have
> recently upgraded some of the color tools on my
> web page to recognize 88 different colors by name.
> (I even added the capability of adding your own
> color names and values as a color value file.) The
> advantage of this method is that it *always* gives
> me the correct color on all machines and in any
> color decomposition state (if I am using IDL 5.2 or
> higher where I can tell what the color decomposition
> state is).
>
> For example, if I want to create background, axes, and
> data plotting colors, I would write my code like this:
>
>    axisColor = FSC_COLOR("Green", !D.Table_Size-2)
>    backColor = FSC_COLOR("Charcoal", !D.Table_Size-3)
>    dataColor = FSC_COLOR("Yellow", !D.Table_Size-4)
>    Plot, Findgen(11), Color=axisColor, Background=backColor, /NoData
>    OPlot, Findgen(11), Color=dataColor
>
> This works for all machines in any color decomposition space.
>
> In addition to FSC_COLOR, the new program PICKCOLORNAME will
> allow the user to interactively select a new color name for
> use with FSC_COLOR:
>
>    ; Set new data color.
>
>    datacolor = PickColorName("Yellow")
>    data = Reverse(Findgen(11))
>    OPLOT, data, Color=FSC_COLOR(datacolor, !D.Table_Size-4)
>
> To see a list of the 88 colors available, type this:
>
>   IDL> Print, FSC_COLOR(/Names)
>
> Or, to see an interactive list of the color names and
> the actual colors:
>
>    IDL> color = PickColorName('dark gray')
>
> You can find the programs here:
>
>    http://www.dfanning.com/programs/fsc_color.pro
>    http://www.dfanning.com/programs/pickcolorname.pro
>
> 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