-2

I have 3 images, Square, Portrait and Landscape. I would like to rotate the images with the angles 90, 180, 270 and 360 degree. How is it possible using Objective-C ?

Nishan29
  • 353
  • 1
  • 4
  • 16

2 Answers2

2

Try this

CGAffineTransform transform;

transform = CGAffineTransformRotate(self.imageView.transform, (M_PI/2));

self.imageView.transform = transform;

ImageView will rotate based on current position....

sam
  • 19
  • 1
0

If want just to display the image, add it to a ImageView and do this:

imageView.transform = CGAffineTransformMakeRotation(M_PI_2);

It will rotate the image 90 degree. Hope this helps.. :)

Rashad
  • 11,057
  • 4
  • 45
  • 73