How can I rotate an Image eg. 180 degrees clockwise using the Matrix
I can use the following code to rotate the image 90 degrees, but it is incremental, meaing
var matrix:Matrix = new Matrix();
matrix.rotate(Math.PI/2);
matrix.tx = imgControl.content.height;
var bitmapData:BitmapData = new BitmapData(imgControl.content.height, imgControl.content.width);
bitmapData.draw(imgControl.content, matrix);
imgControl.source = new Bitmap( bitmapData);
Each time I run the code the image is rotated +90 degrees.
What I want is not to increment by 90 each time, but explicit say rotate 180, rotate90 and so on.
I am not familiar with the Matrix, but I guess it does real bitmapdata manipulation rather than just eg. rotate the Image component box (arrest me if I am wrong).
If so, I guess I have to reset the image each time I do the rotate command.
Am I missing something?
Thanks in advance for any advice and tips
Ran