managed-commons / SvgNet

Fork of the SVG library for .NET that makes a GdiGraphics that "draws" on a SVG model
BSD 3-Clause "New" or "Revised" License
84 stars 37 forks source link

WPF support? #43

Open Shujee opened 3 years ago

Shujee commented 3 years ago

Is there a way/plan to support WPF?

For example, can we export and save a XAML document (specifically a GeometryDrawing which uses a language that is very close to SVG) to SVG format and to reload an SVG file and convert it to a XAML drawing?

monoman commented 3 years ago

No plans currently, we are keeping SVG.NET in maintenance mode, as there are now better alternatives for more advanced usage scenarios of SVG in .NET. Notwithstanding contributions are welcome.

Shujee commented 3 years ago

Thanks. Better alternatives? Anything in your knowledge that could do XAML-to-SVG and back conversion? My googling didn't return anything good, so I'm writing my own conversion code, which is of course less than perfect.

monoman commented 3 years ago

Hi Shujaat,

First the SVG viewing in XAML/WinUI is now directly supported, see: https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.media.imaging.svgimagesource

Also there is a project to load SVG files into DOMs, and convert it to XAML for viewing, that seems to be working fine: https://github.com/ElinamLLC/SharpVectors (BSD 3-Clause)

Really seems that no two-way conversion project is available. That kind of thing is harder to even define/delimit as XAML has lots of controls and interactive features that don't have a way to support/implement in SVG.

SVGNET has a simpler aim, to allow reusing GDI code, within a subset, to generate SVG, which is becoming an outdated need as GDI is superseded by XAML/WinUI more powerful abstractions.

That is why we keep it in maintenance mode, as some projects still depend on it.

Regards,

Rafael Teixeira O..:.)oooo

On Tue, Jun 15, 2021 at 10:31 AM Shujaat @.***> wrote:

Thanks. Better alternatives? Anything in your knowledge that could do XAML-to-SVG and back conversion? My googling didn't return anything good, so I'm writing my own conversion code, which is of course less than perfect.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/managed-commons/SvgNet/issues/43#issuecomment-861500759, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABZ6NF4R7KLNXSXIGEA2Z3TS5I47ANCNFSM46WQFGWQ .