PDA

View Full Version : CGAffineTransformRotate in viewDidLoad doesn't work




Tex-Twil
May 3, 2011, 02:38 AM
Hello,
I need to rotate a UIImageView of a view created by Interface builder. I have this code:


- (void)viewDidLoad
{
[super viewDidLoad];
image.transform = CGAffineTransformRotate(image.transform, REF_INIT_OFFSET*M_PI/180);
}



This rotates the image but the latter is totally distorted. if REF_INIT_OFFSET is a multiple of 90 it works fine !


Do you have in idea what's wrong ?

thanks,
tex



Tex-Twil
Jul 5, 2011, 01:52 AM
Here is how the picture should look like :

http://f.cl.ly/items/1a1P1z2Q2B0A3w3Q0A1t/Screen%20shot%202011-07-04%20at%208.32.11%20PM.png

and here is how it actually looks:

http://f.cl.ly/items/1v0G3h0w1G0N0n2D1C3Z/Screen%20shot%202011-07-04%20at%208.32.32%20PM.png

it looks like the image is stretched into a wrong direction :(