How would one rotate an image around itself using Canvas?

Posted by Wolfr on Stack Overflow See other posts from Stack Overflow or by Wolfr
Published on 2009-10-25T16:28:50Z Indexed on 2010/04/16 15:03 UTC
Read the original article Hit count: 264

Filed under:
|
|

I'm having trouble roating an image around itself using Canvas.

Since you can't rotate an image you have to rotate the canvas: if I rotate the canvas by a degree the origin around which I want to rotate changes. I don't get how to track this change.

This is my current code: http://pastie.org/669023

And a demo is at http://preview.netlashproject.be/cog/

If you want to give things a shot the zipped up code and image is at http://preview.netlashproject.be/cog/cog.zip

© Stack Overflow or respective owner

Related posts about canvas

Related posts about JavaScript