Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>@M.S.B:</p> <p>I think this link will help you.</p> <p><a href="https://stackoverflow.com/questions/1315251/how-to-rotate-a-uiimage-90-degrees">How to Rotate a UIImage 90 degrees?</a></p> <p><a href="https://stackoverflow.com/questions/5581241/how-to-programmatically-rotate-image-by-90-degrees-in-iphone">How to programmatically rotate image by 90 Degrees in iPhone?</a></p> <p>You can refer to this answer by fbrereto in the above link</p> <p>What about something like:</p> <pre><code>static inline double radians (double degrees) {return degrees * M_PI/180;} UIImage* rotate(UIImage* src, UIImageOrientation orientation) { UIGraphicsBeginImageContext(src.size); CGContextRef context = UIGraphicsGetCurrentContext(); if (orientation == UIImageOrientationRight) { CGContextRotateCTM (context, radians(90)); } else if (orientation == UIImageOrientationLeft) { CGContextRotateCTM (context, radians(-90)); } else if (orientation == UIImageOrientationDown) { // NOTHING } else if (orientation == UIImageOrientationUp) { CGContextRotateCTM (context, radians(90)); } [src drawAtPoint:CGPointMake(0, 0)]; return UIGraphicsGetImageFromCurrentImageContext(); } </code></pre> <p><strong>EDIT:</strong> You can refer to answer given by Sabobin under the link <a href="https://stackoverflow.com/questions/5581241/how-to-programmatically-rotate-image-by-90-degrees-in-iphone">How to programmatically rotate image by 90 Degrees in iPhone?</a>. I have posted the same code so that you can refer it from here:</p> <pre><code>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(3.14159265/2); </code></pre> <p>Hope this helps you. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload