views:

388

answers:

3

Flex gives the ability to export a display object as a bitmap as follows:

var bitmapDataBuffer:BitmapData = new BitmapData ( displayObject.width, displayObject.height, false);            
bitmapDataBuffer.draw ( displayObject, displayObject.transform.matrix);

Is there a method to export a display object as a vector graphic instead of bitmap data?

A: 

I'm going to guess from this bug that it's not currently possible:

http://bugs.adobe.com/jira/browse/FP-605

mweiss
A: 

The copyFrom() function on the Graphics object might be what you need. It was added in Flash Player 10.

joshtynjala
That's a cool method! It still doesn't help me do what I need to do, since it transfers between graphics opjects and doesn't allow you to export that data into a format non graphics objects can understand (like svg or some other standard vector format).
mweiss
A: 

In short, no, but you could try to convert to a bitmap and then vectorize the bitmap (something like the marching squares algorithm)

If you are drawing it in AS, you could keep track of your drawing, possibly by extending Graphics & Sprite or Shape to use the new class.

PiPeep