Showing posts with label XamlTune. Show all posts
Showing posts with label XamlTune. Show all posts

Monday, January 19, 2009

XamlTune just got a little better

XamlTune is a fab utility for converting SVG to XAML. It's one of the best things going for conversion from Adobe Illustrator to XAML.

Unfortunately, like all SVG-to-XAML converters, it's flawed in various ways.

I've just released my second patch for XamlTune, which fixes a few more of the flaws and makes Adobe Illustrator to XAML conversion that much easier again.

(You can download my XamlTune patches here.)

Key fixes:

  • SVG shapes (circles, ellipses, etc) that have a transformation matrix, now convert correctly. Woot! (The trick was to convert them into XAML Paths instead of XAML shapes.)

  • SVG circles are now converted into XAML Ellipses, instead of being converted into XAML Paths. (But if the circle has a transformation matrix, we stick with XAML Paths, as per the previous point.)


XamlTune has cost me a few days of debugging work (i.e. debugging XamlTune), but it has saved me much more time than that with an already extensive SVG-to-XAML conversion framework. I am glad to be able to contribute my bug-fixes back to the project and help it help others more.

Enjoy! :o)

Monday, January 12, 2009

Convert Adobe Illustrator files to XAML via SVG

There are lots of ways to convert Adobe Illustrator files to XAML, but for my needs, none of them were quite good enough.

The Adobe Illustrator XAML-export-plugin was mucking up some of our line art.

InkScape's built-in XAML support was mucking things up even worse. (I LOVE InkScape, but its XAML support is still not as good as hopefully it will be one day...)

XamlTune was mucking up a few things here and there as well.

Anyhow, I discovered that, for our line art, the main problem with XamlTune was its handling of thick strokes on ellipses. I fixed the XamlTune source code, submitted a patch, and now, voila, XamlTune is converting our line art perfectly! (Or at least, my eye notices no deficiencies.)

Here are the steps I'm taking:

1) Open the Adobe Illustrator file in Adobe Illustrator. (A free 30 day trial is available.)

2) Save a copy as an SVG document. (There are lots of SVG options, but at least for us, the default SVG options work fine.)

3) Use XamlTune to convert from SVG to XAML.

I doubt my patch will be integrated into the main XamlTune source in a hurry, so if you have enough technical nouse, get my patch from the XamlTune CodePlex site and enjoy the benefits. :o)

Your mileage may vary - apparently SVG to XAML conversion is not good at handling gradients, but all our line art is just simple sets of lines, paths and shapes, so that hasn't been a problem for us...

"Cannot locate resource" in VS.NET 2008 when debugging

I downloaded XamlTune - very helpful, but a little buggy. So I turned to the VS.NET 2008 debugger. But every time I tried to run the XamlTune source code, I would get a "Cannot locate resource 'Output.xaml'" error message at runtime during app startup.

I searched and searched and found zillions of people getting the "Cannot locate resource" error message, but nothing solved the problem in this case.

By trial and error, I finally discovered that the assembly name is the culprit in this case.

The XamlTune "solution" contains a DLL called XamlTune and a separate executable by the same name.

XamlTune.dll
XamlTune.exe

In Release mode, this runs fine, and presumably, in previous versions of VS.NET, it ran fine. But in VS.NET 2008 sp1, running in Debug mode, the aforesaid error occurs.

The solution is extremely simple: Change one or other project file so that the assembly names of the two projects differ.

Clearly a bug in the VS.NET or .NET framework implementation, and it certainly wasted hours of my time today, but when you know how to solve it, everything works nicely again...