apache-flexmxmlflex-sparkfxg

How do I create s:Path.data, polygon coords?


I have a PNG image, the image features a shape surrounded by a transparent area:

sample image

I want to recreate this image as a path in flex mxml, something like this:

<s:Path data="M 0 0 L 0 100 L 100 100 L 100 0 L 0 0" />

How can I export the path data so that I can use this shape in Flex, is there a program that will do this for me?


Solution

  • My problem was that my original image was a flat file, not a path. This meant that following @www.Flextras.com's answer didn't work for me, the result was an FXG with an image embedded.

    The process I used is as follows, I used Adobe Fireworks for this:

    1) Magic wand selection

    Select the body of the image with magic wand.

    Magic Wand Selection

    2) Convert to path

    Right click -> Modify Marquee -> Convert to Path

    Convert To Path

    3) Export as FXG

    File -> Export

    Export As FXG

    4) Done

    Open the FXG in notepad and extract the path data.

    Done