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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:46:35+00:00 2026-06-13T08:46:35+00:00

This is an addition to this similar question: Which is faster when animating the

  • 0

This is an addition to this similar question: Which is faster when animating the UI: a Control or a Picture?.

I am recursively iterating through a tree of shapes and drawing each visible shape to the screen. At about 2-3 generations, things handle smoothly when the user zooms in or pans in real time, but when it gets to about 4-6 generations, things slow down.

To help increase performance, would it be better to draw to a bitmap on every tree-update and then draw that bitmap every invalidation, or to go through the recursion it’s self every invalidation?

I’m working on the solution right now, but your answers are still appreciated before I finish!

  • 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-13T08:46:36+00:00Added an answer on June 13, 2026 at 8:46 am

    Drawing to a bitmap in memory will be faster than drawing to the screen. If you’re re-drawing the entire screen on every update, then you’re much better off composing the bitmap and then blitting that bitmap to the screen. If you’re updating only part of the screen, then you have to weigh whether multiple blits to the screen will be faster than composing the bitmap and drawing the entire thing to the screen.

    In general, you’re better off composing the bitmap in memory and then writing the composed bitmap to the screen. That’s usually faster, and also reduces the flicker that you’ll see if overlapping regions are updated in quick succession.

    Additional info:

    Depending on how large the bitmap is, you might not want to draw the entire thing on every invalidate call. One solution is to update the bitmap in memory as described above, but also keep track of the updated regions (bounding boxes). You can then combine bounding boxes and possibly do several small draw operations that will be faster than drawing the entire bitmap to the screen. This can be much more efficient, but the code becomes pretty complex. Typically, I’ve seen code that says, in effect, “If the number of regions is greater than N, or if the multiple regions cover more than X% of the total area, then just draw the entire bitmap.” The numbers for N and X are determined at program startup time.

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

Sidebar

Related Questions

Previous question which links onto this and has any addition code ref should I
This is very similar to a question I asked the other day but my
I've seen a great answer to a similar question which explains, by inheriting all
This is a similar question to this . I have a GalleryPhoto model with
I know this question has been handeled in similar situations, regarding ASP.Net, before. But
I know this question has been asked and seemingly answered a gazillion times over
I'm back with another similar question. I am currently working on a Java program
Edit: I'd still like to know the answer to this question for knowledge's sake.
Ok...I am new to rails so this may be a stupid question but need
I've asked a similar question before here and the answer solved my problem. However,

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.