Position, normal coordinates, and multiple images [message #87665] |
Fri, 21 February 2014 10:43  |
BLesht
Messages: 89 Registered: March 2007
|
Member |
|
|
This question undoubtedly illustrates my failure to understand graphic windows, etc. For an animation I'm working on I want to place two images (identically sized) side by side and leave room on the right for a color bar, on the bottom for a graphical elapsed time indicator, and on the top for other annotations. To do this, I was adapting another code that did the essentially same thing with a single image. My original code used cgImage with the POSITION parameter set to [0.1, 0.1, 0.8, 0.8] and normal coordinates for the color bar and other various annotations. Before I read the explanation of the position math (http://www.idlcoyote.com/tips/vaughan.html) I naively set the position parameter arrays for the two images I wanted side by side to [0.1, 0.1, 0.4, 0.8] and [0.4, 0.1, 0.8, 0.8] respectively which results in the second image being larger (28% of the window) than the the first (21% of the window). Before I go back to using device coordinates to place the two images, I was wondering if someone more clever than I had a suggestion for accomplishing this using normal coordinates.
|
|
|
Re: Position, normal coordinates, and multiple images [message #87667 is a reply to message #87665] |
Fri, 21 February 2014 10:57   |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Barry Lesht writes:
> This question undoubtedly illustrates my failure to understand graphic windows, etc. For an animation I'm working on I want to place two images (identically sized) side by side and leave room on the right for a color bar, on the bottom for a graphical elapsed time indicator, and on the top for other annotations. To do this, I was adapting another code that did the essentially same thing with a single image. My original code used cgImage with the POSITION parameter set
to [0.1, 0.1, 0.8, 0.8] and normal coordinates for the color bar and other various annotations. Before I read the explanation of the position math (http://www.idlcoyote.com/tips/vaughan.html) I naively set the position parameter arrays for the two images I wanted side by side to [0.1, 0.1, 0.4, 0.8] and [0.4, 0.1, 0.8, 0.8] respectively which results in the second image being larger (28% of the window) than the the first (21% of the window). Before I go back to using
device coordinates to place the two images, I was wondering if someone more clever than I had a suggestion for accomplishing this using normal coordinates.
Oh, my God! I forgot to indicate that article was written tongue-in-
cheek. :-)
Yes, your two images were sized differently because the left one used an
X size of three normalize units, and the right one used an X size of
four normalized units. I think if you matched one or the other of these,
you would get *exactly* what you want. :-)
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.")
|
|
|
|
|