Why is bitmap superior to vector, as3?

Why is a bitmap superior to a vector?

My Flash is for a large kiosk with rich media requirements and needs to function accurately as a counter. I want to keep the vector for scalability.

When I did a simple FPS test, I noticed that my Bitmap version performed fine and the entire vector file was noticeably slower.

PLEASE EXPLAIN
• vector performance • what graphics standards can i apply • solutions for using vector


KIOSK TEST ANALYSIS
alt text http://www.ashcraftband.com/myspace/videodnd/daemonfps.jpg


Results
• only text and bitmap works well, not vectors • background and clouds are fine, but more layers slows it down -

+2


a source to share


1 answer


It really makes sense when you go around what a vector is.

A vector is a visual representation of a computer that draws many dots on the screen and connects to the dots and colors them. This is why the vectors look well scaled as well as downward.

The bitmap, as yours probably known in flash memory, is treated as pixel data. Something is just pictures.

When the screen rendering vectors on each screen are redrawn, it has to render and render and recreate the vector - every time it is designed. With a bitmap - well, its a picture and therefore saves all the processing power trying to redraw complex objects and plot 100 points.

You cache everything as a vector, you won't notice the difference in the most complex ones. Anything you've drawn on stage - check the cache as bitmap box and any new element created in code and added as a child cacheAsBitmap = true

to each visual item.

There is a big trick that should work here.

You can still use your own vectors. However, when adding them to your scene, check the "cache as bitmap" checkbox under display settings in the properties panel.

in code you can write



myCloud.cacheAsBitmap = true

This property is available for every visual object.

This works best when the objects you have in the scene do simple things like rotate and fade out - they are not as effective when animating nested animation movie clips and similar items, since of course the object must still be repainted in every frame. You will still see significant improvement though.


Here are some urls from as3 caching as bitmap '

http://www.adobe.com/devnet/flash/articles/bitmap_caching_03.html

live docs for displayObject - you will see it 3 in the first table.

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html

+6


a source







All Articles