4

I have a complex logo developed in Illustrator that I want to use as an image in WPF. I can seem to combine the Path's when importing into Blend to get a single Path without loosing all the fill colours.

What is the best way to convert the illustrator image into something that can be used in WPF/XAML.

Usually i just combine the Path's into a single Path and then reference the path using the following:

<Application.Resources>
   <Path x:Key="pathKeyName" Data="..."/>

</Application.Resources>


<Path Style="{StaticResource pathKeyName}" />

However there seems to be no easy way to group multiple paths together into a single image that can be used as a resource in a similar manner.

Perhaps there is a way to convert these paths into a Geometry ?

EDIT In the meantime I have used Blend to create a UserControl from the selected paths and then I place this control inside a Viewbox - not quite as simple but it seems to work.

Duncan Groenewald
  • 8,496
  • 6
  • 41
  • 76

1 Answers1

1

No sweat, go grab yourself Mike Swanson's AI to XAML exporter plugin for Illustrator (dont pay attention to the versions mentioned on there, it works just fine with the newest version I use it all the time) and export your logo to XAML for WPF.

Then take that XAML and plop it in a ContentControl like I show how on a previous SO answer post.

Then you plop that Style Template into your resource dictionary or wherever and reference it as such with one line wherever/however you need it, voila. :)

Hope this helps, cheers.

OH PS, if there's a lot of shapes/colors etc, you'll never get it into just one Path, sorry amigo.

Community
  • 1
  • 1
Chris W.
  • 22,835
  • 3
  • 60
  • 94
  • Awesome dude! Thanks. I am sure you can also tell me how I can animate the size of the image, I want it to pulse bigger and smaller by say 20%. I keep getting and error saying property ScaleX is not found on my object (am using a PATH). Will try it on your ContentControl. – Duncan Groenewald May 16 '14 at 04:40
  • I was just being dump - not setting the correct Storyboard.TargetProperty – Duncan Groenewald May 16 '14 at 04:55
  • Good deal, as long as you're sorted. Cheers :) – Chris W. May 16 '14 at 13:03