Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6375297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:35:50+00:00 2026-05-25T01:35:50+00:00

Is it possible to rotate only image in UIImageView? I’m looking for information about

  • 0

Is it possible to rotate only image in UIImageView? I’m looking for information about it, but i only found information how rotate UIImageVeiw.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:35:50+00:00Added an answer on May 25, 2026 at 1:35 am

    You can rotate the image with the following code. Note, this uses a CGImageRef which you can get from a UIImage via

    CGImageRef imageRef = [self CGImageRotatedByAngle:[image CGImage] angle:30];
    

    Once you get the rotated image, you can set the ImageView’s image to your new rotated image like this:

    UIImage* img = [UIImage imageWithCGImage: imageRef];
    myImageView.image = img;
    

    here is a method that will rotate the imageRef:

    - (CGImageRef)CGImageRotatedByAngle:(CGImageRef)imgRef angle:(CGFloat)angle
    {
    
        CGFloat angleInRadians = angle * (M_PI / 180);
        CGFloat width = CGImageGetWidth(imgRef);
        CGFloat height = CGImageGetHeight(imgRef);
    
        CGRect imgRect = CGRectMake(0, 0, width, height);
        CGAffineTransform transform = CGAffineTransformMakeRotation(angleInRadians);
        CGRect rotatedRect = CGRectApplyAffineTransform(imgRect, transform);
    
        CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
    
        CGContextRef bmContext = CGBitmapContextCreate(NULL,
                                                       rotatedRect.size.width,
                                                       rotatedRect.size.height,
                                                       8,
                                                       0,
                                                       colorSpace,
                                                       kCGImageAlphaPremultipliedFirst);
        CGContextSetAllowsAntialiasing(bmContext, YES);
        CGContextSetShouldAntialias(bmContext, YES);
        CGContextSetInterpolationQuality(bmContext, kCGInterpolationHigh);
        CGColorSpaceRelease(colorSpace);
        CGContextTranslateCTM(bmContext,
                              +(rotatedRect.size.width/2),
                              +(rotatedRect.size.height/2));
        CGContextRotateCTM(bmContext, angleInRadians);
        CGContextTranslateCTM(bmContext,
                              -(rotatedRect.size.width/2),
                              -(rotatedRect.size.height/2));
        CGContextDrawImage(bmContext, CGRectMake(0, 0,
                                                 rotatedRect.size.width,
                                                 rotatedRect.size.height),
                           imgRef);
    
    
    
        CGImageRef rotatedImage = CGBitmapContextCreateImage(bmContext);
        CFRelease(bmContext);
        [(id)rotatedImage autorelease];
    
        return rotatedImage;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to auto-rotate the default application image according to current landscape mode?
Is it possible to rotate an image continuously (as in a loading gif) using
Is it possible to rotate text by 90° (clockwise or counter-clockwise) using only CSS
Is it possible somehow to stop UITabBarController to rotate but the UIViewControllers (which are
I did look for possible answers but found none. my problem is that I
Possible Duplicate: Matching a rotated bitmap to a collage image Given an image with
Is it possible to rotate a view using a UIPanGestureRecognizer? I would like similar
Is it possible to rotate a table 30 degrees (and other degrees also) in
Possible Duplicate: how to rotate this openGl code… below is my code and it
I created a camera class. It is possible to rotate 360 degrees with my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.