Color Frustration [message #8375] |
Fri, 28 February 1997 00:00 |
J.D. Smith
Messages: 214 Registered: August 1996
|
Senior Member |
|
|
Seems the more I read this newsgroup, the more problems I have. I am
uttelry frustrated with a color problem. Here is the scenario:
I have a draw widget open, and I am plotting (using plots()) pixel-sized
diamonds over the top of a pixel in an image when a user clicks on that
pixel. In case you were wondering, my pixels are usually resampled to
be big, say 20 screen pixels. I wanted the over-plotted symbols to be
green, so I decided I'd limit the color map range of the image to be 1
fewer than normal, and put green in the topmost color. I even made some
modifications to stretch, etc. so that I would only deal with the
reduced color set when manipulating the images colors. In addition, to
allow the user to de-select a pixel, I keep a copy of the image in a
pixmap, and zap the appropriate pixel back upon de-select (i.e. when the
user clicks again on a previously selected pixel).
Here's the problem: For several clicks, things work fine: The green
points plop down just like I want. But then, after a *random* number of
clicks (usually fewer than 15), the symbols get put down in a different,
seemingly random colors. In addition, de-selecting them doesn't restore
the pixel to it's original color, but leaves the diamond and changes
both its color and the surrounding pixel's color. If, soon after the
funny colors appear, I pull up my color map manipulation tool, the
colorbar is heavily sprinkled (~2/3 of it!) with random stripes of
different, unrelated colors. Switching to different colormaps (eg from
red-linear to black-white linear) only affects a subset of the colorbar.
The other (random) colors remain the same. They are also unaffected by
stretching the colormap. It's as if somehow the colormap was invaded
and forced always to have some random values in places. Very
mysterious. Maybe IDL is losing some colors to the system (X). Any
help which will relieve my extreme agitaion would be most kind.
Thanks,
JD
|
|
|
Re: Color Frustration [message #8377 is a reply to message #8375] |
Fri, 28 February 1997 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
JD Smith <jdsmith@astrosun.tn.cornell.edu> writes:
[Some fantastic story about colors, IDL, and mysterious happenings ....]
This can one of only two things:
(1) TGIF has started earlier than usual at Cornell this afternoon, or
(2) programmer error.
I personally believe (on the basis of previous posts from JD) that
reason (1) is most likely. :-)
David
P.S. We better see a little more of your code. You are not using
a Cursor command in that draw widget, are you?
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
2642 Bradbury Court, Fort Collins, CO 80521
Phone: 970-221-0438 Fax: 970-221-4762
E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com
-----------------------------------------------------------
|
|
|