6 Replies Latest reply on May 9, 2006 11:36 PM by pwyon

    BitmapData

    pwyon
      Hello,
        • 1. Re: BitmapData
          pwyon Level 1
          Oops. Let me finish that. LOL.
          I'm making a simple particle system and I was wondering: would using BitmapData increase the performance? If so, how? Everything I've read on BitmapData gives me a head-ache, but if it will increase performance
          then I will definetly use it. Plus, I can't find many tutorials on this. Any one know of any that are good?

          • 2. Re: BitmapData
            kglad Adobe Community Professional & MVP
            what are you trying to do? some things can only be done using bitmapData. but for performance issues you're just looking at using the cacheAsBitmap property of movieclips.

            if you have a (large) number of movieclips on-stage that are not changing frames, scaling, changing alpha etc, then enabling their cacheAsBitmap property can substantially increase performance.
            • 3. Re: BitmapData
              pwyon Level 1
              Hey Kglad,
              I'm using quite a bit of scaling, rotating , alpha, blur, etc. I have an old smoke-particle system that I made that was pretty cool and I was thinking about redoing it with BitmapData to see if it would run any better. So, what do you think? BitmapData smoke particle system or no?

              Thanks for any help.
              • 4. Re: BitmapData
                pwyon Level 1
                ok, cacheAsBitmap and my particles dont get along. was playing around to see what would happen and woh nelly. sloow. slow slow. i see what your saying kglad. what else is there to try? im lost when it comes to BitmapData.

                i guess i should start small. how would i "loadBitmap" , duplicate it , then move it using a transform matrix? and is it worth trying to do. will i see an improvement in performance?
                • 5. Re: BitmapData
                  kglad Adobe Community Professional & MVP
                  the bitmap has to be regenerated every time you change a movieclip's:

                  _xscale
                  _yscale
                  _rotation
                  _alpha
                  _width
                  _height
                  filters
                  blendMode
                  opaqueBackground
                  transform

                  The bitmap will also be regenerated when:

                  The Timeline playhead changes inside the movie clip
                  When the outer boundaries of the movie clip change
                  When you draw something inside the movie clip with the Drawing API
                  When you attach an image or symbol from the Library into the movie clip
                  Any of the above occur within a nested movie clip (child movie clip)
                  The movie's viewing window changes (for example, the viewer zooms in on the movie by right-clicking and choosing Zoom)

                  if you're doing anything that causes the bitmap to be regenerated, you're decreasing the performance benefit that you see from change a movieclip's _x and _y properties.

                  this is a good place to start with the cacheAsBitmap property:

                  http://www.adobe.com/devnet/flash/articles/bitmap_caching.html
                  • 6. Re: BitmapData
                    pwyon Level 1
                    im off to do some reading. thanks kglad.

                    if you'ld like the see my old smoke-particles let me know. you might have some ideas for what i could do to make it better.