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 8173503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T22:10:46+00:00 2026-06-06T22:10:46+00:00

I have a large sized image (2048*2048px), this image is shown as 320*320 on

  • 0

I have a large sized image (2048*2048px), this image is shown as 320*320 on iPhone screen. I want to do this:

In my APP, user can open large sized image(e.g. 2048*2048), the image is shown as 320*320 on iPhone screen, and there is rectangle over the image, user can move the rectangle anywhere within image on iPhone screen, e.g. rectangle(100, 100, 300, 200), then I want to clip the original sized image within the rectangle area in scale.

I tried many ways,

UIImageView *originalImageView = [[UIImage View alloc] initWithImage:originalImage]];

CGRect rect = CGRectMake(100, 100, 300, 200);

UIImage *cropImage = [UIImage imageWithCGImage:CGImageCreateWithImageInRect([originalImageView.image CGImage], rect)];

But I got the cropImage is just 300*200 sized image, not scale properly.

  • 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-06T22:10:48+00:00Added an answer on June 6, 2026 at 10:10 pm

    How about doing this, it will preserve the original image quality

    CGSize bounds = CGSizeMake(320,320) // Considering image is shown in 320*320
    CGRect rect = CGRectMake(100, 100, 220, 200); //rectangle area to be cropped
    
    float widthFactor = rect.size.width * (originalImage.size.width/bounds.size.width);
    float heightFactor = rect.size.height * (originalImage.size.height/bounds.size.height);
    float factorX = rect.origin.x * (originalImage.size.width/bounds.size.width);
    float factorY = rect.origin.y * (originalImage.size.height/bounds.size.height);
    
    CGRect factoredRect = CGRectMake(factorX,factorY,widthFactor,heightFactor);
    UIImage *cropImage = [UIImage imageWithCGImage:CGImageCreateWithImageInRect([originalImage CGImage], factoredRect)];
    

    And most importantly if you want to crop image that imagePickerController returns, then this can be done by built in function as below,

    imagePickerController.allowsEditing = YES;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a large sized image. At runtime, I want to read the image
in my app, i have large images, i display it in an image view
I have two large identical-sized files. One is ASCII plain text, and the other
I have a very large UIView approx 3000x3000 in size. In this large view
Many hex editors, such as Hex Workshop, can even read large-sized files while keeping
The problem: We have large product images we want thumbnails of at various size
I have a game which displays a full screen image in the background. At
I have large zoomable bitmaps with text, that I want to resize a little
I have a large Png image file that I would like to display and
I have a large image I would like as my background, but for some

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.