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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:12:14+00:00 2026-06-10T04:12:14+00:00

I my app, i have one uiscrollview and have subview uiimageview on it, when

  • 0

I my app, i have one uiscrollview and have subview uiimageview on it, when user clicks any photo from library it display on that imageview, user can move,zoom and scale the image, when user clicks crops button it should crop that part which is in imageview, in iPhone 3GS its working perfectly fine, however in retina it not working correctly cropping is showing different image.

- (UIImage *)currentSlice {

    CGSize sliceSize = imageView.frame.size;

    UIGraphicsBeginImageContextWithOptions(sliceSize, NO, 0.0);
    [imageView.image drawInRect:CGRectMake(0, 0, sliceSize.width, sliceSize.height)];
    UIImage *scaledImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();

    CGRect sliceRect = CGRectMake(scrollView.contentOffset.x, scrollView.contentOffset.y, scrollView.frame.size.width, scrollView.frame.size.height);
    CGImageRef imageSlice = CGImageCreateWithImageInRect(scaledImage.CGImage, sliceRect);
    return [UIImage imageWithCGImage:imageSlice];
}

i have used this method for cropping, please help me with this issue

  • 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-10T04:12:15+00:00Added an answer on June 10, 2026 at 4:12 am

    Frame size does not represent physical pixel.
    So, if you are working with retina do below change.

    CGSize sliceSize = CGSizeMake(imageView.frame.size.width * 2.0, imageView.frame.size.height * 2.0);
    
    CGRect sliceRect = CGRectMake(scrollView.contentOffset.x, scrollView.contentOffset.y, scrollView.frame.size.width * 2.0, scrollView.frame.size.height * 2.0);
    

    Rest of the things are fine.

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

Sidebar

Related Questions

I have one simple app that suppose to get information from user and send
In my iPad App, I have one custom class inherited from UIButton. I am
I'm hearing that is better to have one connection open upon app start up
Basically, I want to have an app with only one view that has an
I have a horizontal UIScrollview set up (meaning its not one that scrolls up
In my app I have one imageView and one UILabel. For ImageView I have
Hello i have a uiscrollview and i have one object of uiimageview inside the
In my app I have three tables: Users Profiles Friends The User has one
I have one app, a UIImage* . I'm painting the image twice: Once in
In my app i have created one custom class for Label.Now i want to

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.