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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:18:45+00:00 2026-05-27T14:18:45+00:00

I need to draw onto a very, very wide context (possibly going into the

  • 0

I need to draw onto a very, very wide context (possibly going into the 100,000’s of pixels in width)

The stuff that I am drawing is simple (exclusively lines, ellipses and arcs).

Currently, I am using a tiling mechanism to render pieces of this image as SVG graphics in UIWebViews sitting in a UIScrollView. Horrible, I know. Performance is so bad it makes me want to hurt myself.

So I’m left with no choice but to draw things directly in Quartz. The problem is that I couldn’t find any good information on handling such a large drawing.

The commands will be stored in a array (i.e [0] – line from x1,x2 to y1,2 [2] – arc at x1,x2,h,v etc…) which makes it possible to immediately determine what needs to be drawn at any point of time.

How should I best go about handling the actual drawing? Make a ginormous context then draw onto it, erasing the parts that go off screen? Can I draw straight into the UIScrollView?

Or am I supposed to performing some sort of tiling? Creating smaller views and drawing on them?

  • 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-27T14:18:46+00:00Added an answer on May 27, 2026 at 2:18 pm

    Look into CATiledLayer. It supports huge dimensions, yet only draws “tiles” that are visible. This means that in your drawLayer:inContext: you need to calculate how to draw the tile you were asked to draw. That might be quite complicated to implement but the performance boost makes up for this. I use this to draw a “strip” that is often over 20.000 pixels wide, tiled into 256 pixel pieces (this is the default).

    You not only want this because of speed but also due to memory: if you really had a view or layer that were that big it would take up immense amounts of memory. Tiling is the only solution here.

    See this nice article by Michael Heyeck on how to use CATiledLayer (Apple has a demo as well, but I think the linked article is better).

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

Sidebar

Related Questions

I need to draw text onto a window HDC along a circular path using
I need to draw a counter onto an OpenGL view. Here is my source
I need to draw a circle onto a bitmap in a specific colour given
In my app I need to draw a widget contents onto Bitmap. The code(pseudo)
I am attempting to draw an image onto a CALayer. I only need an
I am writing a VCL/Delphi Application, and I need to draw text onto a
I need to draw images into a CALayer because I need to perform various
I have a SurfaceView that I draw onto, there are no controls, text boxes
I have made a program that allows users to draw lines onto a picturebox
so having a canvas and canvasContext I want to draw an image onto that

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.