Parth Bhatt Parth Bhatt - 1 month ago 12
Objective-C Question

How to programmatically rotate image by 90 Degrees in iPhone?


Possible Duplicate:

How to Rotate a UIImage 90 degrees?




How to programmatically rotate image by 90 Degrees in iPhone?

Answer
//create rect
UIImageView *myImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"my_image.png"]];

//set point of rotation
myImageView.center = CGPointMake(100.0, 100.0);

//rotate rect
myImageView.transform = CGAffineTransformMakeRotation(M_PI_2); //rotation in radians
Comments