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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:50:08+00:00 2026-05-23T13:50:08+00:00

Developing an iPad PDF-Reader we decided to prepare high-res images of rendering intensive pages

  • 0

Developing an iPad PDF-Reader we decided to prepare high-res images of rendering intensive pages (lots of paths in them) and use those instead of the pdf pages to avoid performance issues. We decided that 3*768 by 3*1024 is a good compromise between readability and rendering performance which results in ~1.5 MB jpegs.

However we tested two implementations for displaying the image pages. One that uses a CATiledLayer subclass which is also responsible for handling the “normal” PDF pages (drawing with CGContextDrawImage) and another which uses UIImageView. The latter has the advantage that displaying and zooming is very quick, but memory usages is really bad – it takes about 30 MB in memory (which is consistent with the image’s bitmap size). The other approach (CATiledLayer) needs more time to first display the page and needs another two seconds to re-render after zooming (similar to pdf pages, but much faster) but doesn’t grab more memory than it needs to display a much smaller image or a PDF page.

Does anyone know what’s going on behind the scenes and if it’s possible to combine low memory usage of CGContextDrawImage with high performance of UIImageView by using the Quartz Framework.

  • 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-23T13:50:09+00:00Added an answer on May 23, 2026 at 1:50 pm

    Not sure if this question is still relevant, but if so, maybe this will help:

    I’ve fought the battle of efficient display of large views in my tiled image view as well. There are a bunch of underlying parts to the problem:

    • A normal UIView, including UIImageView, seems to always be completely backed by memory for its image. Even if you implement the drawRect: method, it always seems to pass the entire bounds of the view, not only the area visible within a scroll view. As you’ve discovered, this quickly takes up a lot of memory as each pixel takes 4 bytes.
    • The CATiledLayer does only request the contents for visible tiles. It also discards tiles that are no longer visible – this is where the memory savings come from. However, it does the notification and the drawing on a background thread, while animating from white to the contents. It seems to do this via a private API, I haven’t found a way to re-implement CATiledLayer‘s functionality as my own subclass of CALayer, as there simply seems to be no notification mechanism that we can use as mere mortals.
    • If you have multiple views within the scroll view, they receive drawRect: messages appropriately as they are paged in. UIKit seems to struggle with too many subviews below a view, though.

    For you, I can see a couple of possible options:

    • It might be possible to salvage the CATiledLayer-based implementation. The fadeDuration defaults to 0.25 seconds, which may be too long if your load times are short. You can drop this right down to something like 1.0/60.0, i.e. one frame. One thing that’s not clear from your description is whether your images cover the whole page size or just each 256×256 pixel tile. Decoding the whole JPEG over and over again for each tile will be much slower than decoding individual tile files.
    • If the latency from doing everything from the CATiledLayer thread is too high, you can manually create a bunch of tiles as UIImageView subviews to a blank UIView which is the main subview to the scroll view. Each of these subviews is assigned its own tile image. If you’re lucky, UIKit will be smart enough to drop the contents of these views and re-load the corresponding JPEGs on demand.
    • If UIImageViews aren’t smart enough, or you have too many views for UIKit to cope, you can build your own views which load their JPEGs in drawRect:. If it’s still too jerky, try with your own CALayers, which will be sublayers of your single view’s blank layer and again load their image on demand. This is what I eventually went with for my tiled image view.

    That should cover scrolling, but it could still be really slow if you allow the user to zoom right out (minification). In that case I recommend you store appropriate lower-resolution versions and load/show those at those outermost zoom levels.

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

Sidebar

Related Questions

I am developing iPad PDF viewer application for iPad. I am stuck with 2
i am developing an application on ipad to read and annotate pdf's.My application is
i developing an iPad app in which i working with images.The application is worked
Hi I am developing an ipad Magazine app where I need to display pdf
I am developing an iPad application in which I need a table view (
I'm developing an iPad application. I have been provided with a PNG image that
Am developing an ipad app in which I want to pop up the MPMoviePlayer
I am developing an iPad application. I have an SQLite database in my resource
I am developing a iPAD app with a UITabViewController and some custom controllers initialized
I'm developing an iPad application for a company. Because of confidentiality reasons they do

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.