Image Quality degrades on rotation
Posted: Thu Mar 31, 2011 4:34 pm
I am playing with Livecode and basic animation. One of the things I wish to create is a one handed clock so I need to be able to rotate a hand. As an experiment I used an image of a JAS39 and duplicated it three times. I created two routines to rotate a .png image.
I have three questions: 1) Why does the rotate command cause such a problem? 2) Is there a better way of rotating an image? 3) Is it possible to rotate a graphic e.g. an arrow drawn in Livecode?
best wishes
Simon
Looking at the attached png file the image on the left is the original, the one in the middle has been rotated using the set angle command and the last image has been rotated using the built in rotate command. Both the routines use timers to re-call themselves and both move their image by 10 degrees. Both methods cause problems: the set angle causes some jagged edges to appear while the rotate command causes the image to break up. My button code is posted below:
Code: Select all
on mouseUp
if the flag of me is empty then set the flag of me to false
set the flag of me to not the flag of me --toggle the boolean flag which is a custom property
If the flag of me then
Rotatehand
RotatehandB
end if
end mouseUp
On rotatehand
set the angle of image"JAS39" to the angle of image"JAS39"+10
if the flag of me then
send rotatehand to me in 500 millisecs
end if
end rotatehand
On rotatehandB
rotate image"JAS39B" by 10
if the flag of me then
send rotatehandB to me in 500 millisecs
end if
end rotatehandB
best wishes
Simon