PDA

View Full Version : Shape Bytes of a Circle


hallenberg
01-08-2010, 01:30 PM
Consider a simple circle shape with a solid black fill and no stroke..

When this circle is drawn in the Flash IDE (CS4) using the 'oval tool', it appears to use 8 points, each with 2 bezier handles..

When the circle is drawn in Illustrator (CS4), it appears to use 4 points, each with 2 bezier handles..

I assumed that the latter shape would represent less shape data. However this doesn't appear to be true.. In testing, I brought the Illustrator shape into Flash four different ways:

1. Illustrator-saved AI, Flash import;
2. Illustrator export to SWF, Flash import;
3. Copy to clipboard, paste into Flash with 'apply recommended import settings to resolve incompatibilities' option checked;
4. Same as previous but without option checked.

The resulting shapes (in Flash) each had 4 points except for the second option which had 8 points, just like the circle drawn with the Flash 'oval tool'.

With each as separate symbols in the library, I placed all of them on the stage (alongside another circle symbol I had drawn using the Flash 'oval tool') and tested the movie in order to generate a size report.

Interestingly only one symbol reported any shape bytes; the rest reported zero. The symbol that reported bytes was whichever appeared 'on top' in the z-order, and it was consistently 69 bytes. This is interesting as it appears that Flash recognised the similarity in shapes (and the identical base colour) enough to register only one of them. (By the way 69 bytes is without movie compression since the compressed size of symbols appears to fluctuate depending on the other contents of the SWF.)

Regardless of whether the stage contained all symbols, or alternately only 4-point or 8-point circles, I got the same shape bytes.. So what? I'm just a bit surprised by this; if anyone happens to know more about the mechanics in effect here I'd be interested to hear.