Re: CURSOR skips a few beats :-( [message #69628 is a reply to message #69626] |
Thu, 28 January 2010 15:35   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Gianguido Cianci writes:
> Right, you can join the dots... so when IDL plots the line between the
> dots, it calculates which pixels need to turn white. How do I get the
> coords of all those pixels?
I'm not trying to be a smart-aleck here, but why do you
want them? (I'm trying to figure out the best way to
answer your question. Maybe the best way is to avoid
the headache of getting things you don't need!) Anyway,
what are you going to do with them when you get them?
> I have come up with a three-step linear interpolation that I do
> between each pair of points and it seems to be working (with 2 probs).
> here is a snippet:
Uh, have you given any thought to writing a widget program? :-)
> Problem #1: it is not very pretty, but I could live with that I
> suppose. Though I feel there must be a better way.
I think so, too, but I can't tell yet what it is.
> Problem #2: when you (slowly!) move the mouse out of the left edge of
> the window the program crashes because x1= 0>x1<f_xsize-1 sets x1 to
> -1!!! And I can't figure that one out :-(
Well, this is one of the most common gotchas in IDL! You
need parentheses.
x1 = 0 > x1 < (f_xsize-1)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|