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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:27:55+00:00 2026-06-14T22:27:55+00:00

I have created a UIImageview programmatically, and I am showing an image from a

  • 0

I have created a UIImageview programmatically, and I am showing an image from a string which contains url of a picture

But I wish to show a part(a rectangle at center) of the original image. How do I achieve this?

    NSString * urlString = @"http://4.bp.blogspot.com/-  rEqVgkdnuxE/TWd6Fm6EWtI/AAAAAAAABSc/cWCehI51v_Y/s1600/red_rose_flower3.jpg"

   NSURL *url = [NSURL URLWithString:urlstring];
   NSData *data = [NSData dataWithContentsOfURL:url];
   UIImage *img = [[UIImage alloc] initWithData:data];
  • 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-14T22:27:56+00:00Added an answer on June 14, 2026 at 10:27 pm

    Try this on for size 🙂

    UIImageView *imageView = [UIImageView alloc] initWithImage:image];
    [imageView setFrame:SIZEOFRECTANGLE];
    [imageView setContentModeCenter];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIScrollView and a UIImageView which I have created programmatically without interface
I created a UITableViewCell in Interface Builder which I have added a UIImageView and
I have created a few UIImageViews programmatically, but I have a feeling that even
I have button created programmatically in the UIImageView. This view was also created programmatically.
I have created a scrolling/zooming image view by placing a UIImageView within a UIScrollView.
I have a programmatically created UIImage image, using this kind of code: UIGraphicsBeginImageContextWithOptions(CGSizeMake(128, 128),
I have a button that will programmatically create a UIImageView with an image for
I have created a custom .xib that contains a TableViewCell that contains a UIImageView
I have created one application in which i want to display compass.but my application
I have created one UIImageView Here's code capView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:kARROW_CAP_NAME]]; capView.frame

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.