metacard digest, Vol 1 #80 - 4 msgs

John Vokey vokey at uleth.ca
Sun Jan 27 15:45:01 EST 2002


Thanks Philip.  That indeed does seem to be the problem.  Thanks 
for the suggested fix as well.

On Sunday, January 27, 2002, at 10:12  AM, Philip Chumbley wrote:

> To illustrate the situation in one dimension, if a line is 99 
> pixels wide,
> its centerpoint is at 50 with 49 pixels before and 49 pixels after the
> centerpoint.  But if the line is 100 pixels wide, the 
> centerpoint is actually
> at 50 1/2.  Since you can't center the line on a half pixel, 
> the line would
> be shifted slightly right or left from true center (depending 
> whether you
> round up or truncate the number) so the image is now offset.  
> If you now make
> the line 99 pixels wide again it will stay centered in the same 
> place but
> switching it back to 100 pixels wide again will shift it once 
> again.  If the
> half-way points are rounded up (ie. 50 1/2 --> 51), the effect 
> would be that
> a line would drift to the left or an image to the upper left.  
> To correct for
> that, simply read the location of the first image into a 
> variable (oldLoc)
> and include a line saying:
>
> set the loc of image myImage to oldLoc
>
> after setting the filename.  Be aware that you may see the image "jump"
> slightly.  If that is unacceptable, make the image invisible, set the
> fileName to the new name, set the loc to the oldLoc , and then make it
> visible.  In my application I use two images.  While viewing 
> one, I set the
> file name of the invisible one and reposition it and then hide 
> one and show
> the other.
>
> Hope this helps.
>
> Philip Chumbley
>
--
John R. Vokey, Ph.D.                       |\      _,,,---,,_
Professor                                  /,`.-'`'    -.  ;-;;,_
Department of Psychology and Neuroscience  |,4-  ) )-,_. ,\ (  `'-'
University of Lethbridge                  '---''(_/--'  `-'\_)




More information about the metacard mailing list