1

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?

mweiss
  • 1,363
  • 7
  • 14

4 Answers4

1

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

Josh Tynjala
  • 5,235
  • 3
  • 23
  • 25
  • 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 Jun 24 '09 at 17:07
1

You can use the svgeditor-as3 library, however it uses it's own drawer engine, but it's very powerful, and can export in SVG format.

You can find more here: http://code.google.com/p/svgeditor-as3/

Tamas Gronas
  • 573
  • 3
  • 8
0

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

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

mweiss
  • 1,363
  • 7
  • 14
0

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.

bgw
  • 2,036
  • 1
  • 19
  • 28