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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:40:15+00:00 2026-05-28T17:40:15+00:00

I have a 400 pattern images at 400×300 bundled within my app. I would

  • 0

I have a 400 pattern images at 400×300 bundled within my app. I would like to make some kind of factory method to take a portion of that image and load them into UIImageViews. I’ve had some success with using content mode and clipping to bounds, but when I load a ton of these into a view it can take upwards of 5 seconds for the view to load. Here is an example of my current method.

UIImageView *tinyImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed@"400x300testImage.png"];
[tinyImageView setFrame:CGRectMake(0, 0, 10, 200)];
[tinyImageView setContentMode:UIViewContentModeTopLeft];
[tinyImageView setClipsToBounds:YES];
[self.tinyImagesView addSubview:tinyImageView];

I’ve been reading the ImageIO class files and I think my answer is in there but I’m having a hard time putting together workable code. In another stackoverflow question I came across this code

CFDictionaryRef options = (__bridge CFDictionaryRef)[NSDictionary dictionaryWithObjectsAndKeys:
                                                (id)kCFBooleanTrue, (id)kCGImageSourceCreateThumbnailWithTransform, 
                                                (id)kCFBooleanTrue, (id)kCGImageSourceCreateThumbnailFromImageIfAbsent, 
                                                (id)[NSNumber numberWithFloat:200.0f], (id)kCGImageSourceThumbnailMaxPixelSize, 
                                                nil];
    CGImageRef imgRef = CGImageSourceCreateThumbnailAtIndex(imageSource, 0, options);

    UIImage *scaled = [UIImage imageWithCGImage:imgRef];

    CGImageRelease(imgRef);
    CFRelease(imageSource);

    return scaled;

This has a similar load time to loading the full images and clipping.

Is it possible to read in only a 10×200 strip of an image file and load that into a UIImageView that is as fast as creating that 10×200 png and loading that using imageNamed?

  • 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-28T17:40:16+00:00Added an answer on May 28, 2026 at 5:40 pm

    I’m pretty sure what you really want is a CATiledLayer, where you can point it at the set of images and have it automatically pull up what it needs.

    You can just add a CATiledLayer to any UIView.

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

Sidebar

Related Questions

I have a table that has about 400,000+ rows. I am writing some pattern
I have 400 images in my server database. I am able to get those
I have around 400 GB Live mysql Databases on one server and I like
I have like 400 records on my database, suppose this is the first version
I have an application with like 400 records in the database, I have splash
I have 400 million tweets ( actually I think its almost like 450 but
I have a tab separated file like this: Supercontig_1.1 400 1500 1 4 Supercontig_1.1
I have some kind of controller: @Controller public class DefaultController { @RequestMapping(value=/index.html, method=RequestMethod.GET) public
I have more than 400 000 id's in NOT IN statement. Whether it will
I have a square 400 x 400 with a plane projection attached to it

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.