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

  • SEARCH
  • Home
  • 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 7770445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:24:44+00:00 2026-06-01T16:24:44+00:00

Is there a way to load a picture from the library or take a

  • 0

Is there a way to load a picture from the library or take a new one, resize it to a smaller size to be able to edit it and then save it at the original size? I’m struggling with this and can’t make it to work. I have the resize code setup like this :

firstImage = [firstImage resizedImageWithContentMode:UIViewContentModeScaleAspectFit bounds:CGSizeMake(960, 640) interpolationQuality:kCGInterpolationHigh];

and then i have an UIImageView :

[finalImage setFrame:CGRectMake(10, 100, 300, 232)];
 finalImage.image = firstImage;

if I setup the CGSizeMake at the original size of the picture it is a very slow process. I saw in other apps that they work on a smaller image and the editing process is fairly quick even for effects. What’s the approach on this?

  • 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-06-01T16:24:45+00:00Added an answer on June 1, 2026 at 4:24 pm

    You can refer to Move and Scale Demo. This is a custom control which implements Moving and scaling and cropping image which can be really helpful to you.

    Also this is the most simple code for scaling images to given size. Refer to it here: Resize/Scale of an Image

    You can refer to it’s code here

    //  UIImage+Scale.h
    
    @interface UIImage (scale)
    
    -(UIImage*)scaleToSize:(CGSize)size;
    
    @end
    

    Implementation UIImage Scale Category
    With the interface in place, let’s write the code for the method that will be added to the UIImage class.

    //  UIImage+Scale.h
    
    #import "UIImage+Scale.h"
    
    @implementation UIImage (scale)
    
    -(UIImage*)scaleToSize:(CGSize)size
    {
      // Create a bitmap graphics context
      // This will also set it as the current context
      UIGraphicsBeginImageContext(size);
    
      // Draw the scaled image in the current context
      [self drawInRect:CGRectMake(0, 0, size.width, size.height)];
    
      // Create a new image from current context
      UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext();
    
      // Pop the current context from the stack
      UIGraphicsEndImageContext();
    
      // Return our new scaled image
      return scaledImage;
    }
    
    @end
    

    Using the UIImage Scale Method
    Calling the new scale method we added to UIImage is as simple as this:

    #import "UIImage+Scale.h"
    
    ...
    
    // Create an image
    UIImage *image = [UIImage imageNamed:@"myImage.png"];
    
    // Scale the image
    UIImage *scaledImage = [image scaleToSize:CGSizeMake(25.0f, 35.0f)];
    

    Let me know if you want more help.

    Hope this helps you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to have a single full-screen picture load when the cocoa
Is there any way to load a swf file and display it in a
Is there a way to load and run an EXE file on the client
Is there another way to load MSHTML documents without use Application.ProcessMessages? To load a
Is there a way to load external CSS files, like we load JS file
Is there a way to load a table view that opens at the second
Using System.AddIn, is there a way to load and activate an AddIn without locking
I am doing web development in ASP.NET. Is there some way to load different
Is there a way to only load child nodes when the parent node is
Is there a way to make a python module load a dll in 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.