SVG RRS feed

  • Question

  • Does anybody have an idea how to display SVG graphics with windows forms. We have a requirement to display and print SVG and to have an editable layer on top of the SVG graphics.

    is there a XAML component that is already working with the .net 2.0 framework. We can't ship a comunity technology preview.

    thanks for any help


    Tuesday, January 31, 2006 7:19 PM


All replies

  • There is no XAML component apart from the CTP stuff.

    SVG runs in a browser, so you could embed IE in your app and install SVG to the local system.  I've not heard of any non browser support for SVG, although it would not surprise me.

     I should mention that SVG and WPF, although both XML based, are totally different beasts.  WPF does not support SVG.

    Tuesday, January 31, 2006 8:42 PM
  • Hi,

    Sure XAML and SVG aren't quite the same, but you can convert a subset from SVG to XAML and if there would be a XAML component not running under the CTP - I would probably be allright.

    Is there a way to convert SVG to an other common vector format - well, EMF would be allright... but there is no way to convert SVG to EMF, is there?



    Tuesday, January 31, 2006 8:50 PM
  • Yes, I'm sure you could write an XSLT that would convert between the two.

    I take it your SVG image is going to be static then, no animations ? There's no automatic way to do that conversion that I know of, no, and when I looked at the metafile support in .NET ( admittedly it was .NET 2002 ), it was very, very broken. 

    Assuming you're just displaying a vector image that happens to be done in SVG, perhaps you could write code to parse the SVG and just render it yourself ? If it's just static lines and shapes, that shouldn't be too hard, probably easier that writing code to convert SVG to EMF.  It's a bit of work though, compared to a canned solution, if one existed.

    The other issue with WPF is that it only works on XP SP2 and above.


    Tuesday, January 31, 2006 9:01 PM
  • Hi,

    What do you mean "it was very, very broken" ? Can you point out what worked and what didn't? You statement sounds a little unclear.

    The other thing is, that as soon as you can render to a graphics object you get an emf for free. I don't understand your point why rendering should be cheaper than converting to emf. Could you point that our for me, too?

    Anyway, I made my mind up and wrapped the SVG rendering Engine from SvgVectors (https://sourceforge.net/projects/svgdomcsharp/) to write me an EMF. So far I haven't noticed any side effects. Anyway, it's a hack, but working properly with our samples.



    Wednesday, February 1, 2006 6:00 PM
  • Try this link: http://www.adobe.com/svg/viewer/install/main.html

    At the menubar at the left (at the site mentioned above) you will find some helpful examples.


    Wednesday, February 15, 2006 7:51 PM