I would like to rotate UIImage not the UIImageView on clicking rotate button not on orientation change. Please reply.
Asked
Active
Viewed 940 times
3 Answers
1
Edited:
use http://developer.apple.com/library/ios/documentation/uikit/reference/UIImage_Class/Reference/Reference.html#//apple_ref/doc/uid/TP40006890-CH3-SW37 for IOS 4 , if you want to rotate image
or you can use: http://www.platinumball.net/blog/2010/01/31/iphone-uiimage-rotation-and-scaling/
or

Mujah Maskey
- 8,654
- 8
- 40
- 61
-
i dont want to rotate image view i need to rotate iamge and than save it – Harshal Jul 06 '11 at 05:20
1
CGSize size = sizeOfImage;
UIGraphicsBeginImageContext(size);
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextRotateCTM(ctx, angleInRadians);
CGContextDrawImage(UIGraphicsGetCurrentContext(),
CGRectMake(0,0,size.width, size.height),
image);
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;

Nitish
- 13,845
- 28
- 135
- 263
-
can please let me know what will come in foll: sizeOfImage image(in cgrectmake) – Harshal Jul 06 '11 at 05:13
-
you should declare source where you had copied. http://stackoverflow.com/questions/917713/uiimage-rotation-custom-degrees/918794#918794. – Mujah Maskey Jul 06 '11 at 05:41