PDA

View Full Version : Rotating an image from it's center?


whisperstorm
10-17-2003, 10:40 AM
I've seen that you can rotate an image using the axis in the upper left hand corner - how do you rotate something where the axis of rotation is somewhere else --- like say you wanted an image of a record to spin.

antun
10-17-2003, 12:04 PM
Right now there's no way of programatically specifying a center of rotation - we're working on sensible APIs for that. It may sound like a simple issue, but there's a lot below the surface (e.g. if you rotate a square box that's 50px wide by 45 degrees, how wide is it?)

To get something to rotate around it's center, offset it by half its width and height within a containing view with an empty view, and then rotate that containing view.

I did that here:

http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&threadid=281&highlight=rotation

-Antun

antun
10-17-2003, 03:11 PM
You might also want to check out this week's tip:

http://www.laszlosystems.com/developers/community/forums/showthread.php?s=&threadid=448

-Antun