How do I convert an Illustrator file to a path for WPF

10,361

Solution 1

We use Expression Design to do this.

Unfortunately, there currently is no free beta preview like Blend 2.5, however, you can download a trial copy (which I think you can use for 90 days).

If you don't want to go this route, I know that a lot of people also use Mike Swanson's exporter that is pointed to by curtisk above.

Solution 2

This should fit the bill AI->XAML

Solution 3

You can go from AI to SVG to XAML.

  1. From Adobe Illustrator: File -> Save As -> *.SVG.

    • SVG "Profile 1.1" seems to be sufficient.

    • Note that to preserve path/group names in XAML you should enable "Preserve Illustrator Editing Capabilities" (or at least as it's called in CS4).

  2. SharpVectors can convert SVG data to XAML data. This will produce a fragment of XAML with root <DrawingGroup>.

  3. Do what you need to do to copy-paste and otherwise use the XAML, such as placing it into an Image like below. Named objects or groups in the AI file should still have their names in the XAML i.e. via x:Name="...".

<Image>
  <Image.Source>
    <DrawingImage>
      <DrawingImage.Drawing>
        <DrawingGroup ... the output from step #2 ...>...</DrawingGroup>
      </DrawingImage.Drawing>
    </DrawingImage>
  </Image.Source>
</Image>
  1. Coordinate systems can be a pain if you want to be animating things. There are some other posts such as this which may have insights.
Share:
10,361
ScottG
Author by

ScottG

I am a software architect in Detroit, Michigan specializing in e-commerce on the Microsoft stack (ASP.NET MVC, WPF, WCF, SQL Server, and C#). I write software that integrates with Amazon MWS and AWS, Paypal, Google, Jet, and ChannelAdvisor among others.

Updated on June 03, 2022

Comments

  • ScottG
    ScottG about 2 years

    Our graphics person uses Adobe Illustrator and we'd like to use her images inside our WPF application as paths. Is there a way to do this?

  • TripleAntigen
    TripleAntigen over 8 years
    FINALLY someone describing what you need to do with the XAML DrawingGroup. Thanks a lot!