+ Reply to Thread
Results 1 to 2 of 2

Efficient way to animate changing colors for a large number of shapes?

  1. #1
    Registered User
    Join Date
    12-22-2011
    Location
    Unites States
    MS-Off Ver
    Excel 2007
    Posts
    1

    Efficient way to animate changing colors for a large number of shapes?

    I'm trying to create an animated process flow diagram for an assembly line, where each process is represented by a color-changing shape. white=empty. blue,green,and yellow=different product types occupying each process. outlined in red=finished and waiting on the next process to advance.

    I can't really upload the code, since it's full of specific company info., but it basically loops once a second (actual line speed, not animation playback speed) through each job from finish to start, checking to see whether the job is complete, and advances if the next job is open. Once it advances, the elapsed time for the current job resets to 0. DoEvents occurs at the end of each time step to refresh the graphics.

    This seems to work efficiently enough for a small number of processes (about 8-10), but when I try to go full-scale and add about 100 processes, it just slows to a crawl, and DoEvents fails to refresh the image. I tried switching between Application.ScreenUpdating = False/True, but it caused a lot of flickering and ran even slower.

    I've been looking into creating a ''process" class or dictionary, but I'm not sure if it would be any more efficient than the current array setup.

    I'm also considering processing all of the data first, storing it into large 2d arrays spanning the course of about 20 minutes, ColorAtTime(100,1200), and retrieving that info later for the animation.

    What's the most efficient way to change the colors of so many shapes at once? Right now, the colors for each job are stored as byte variables in an array. Is it possible to make a shaperange for each different color and update all of the shapes at the same time without having to loop through each one individually?

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Efficient way to animate changing colors for a large number of shapes?

    Hard to say without at least seeing some code.

    This example will generate 400 rectangles and alter their fill colour in various ways.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1