Open bhood-zorus opened 5 years ago
Besides an SvgSource
class, it would be awesome to have SvgBrush
and SvgDrawing
too, etc.
and what about gif support ?
You already have DrawingImage
, DrawingBrush
and GeometryDrawing
which are vector based and can cover most simple SVG graphics, you just have to write a loader, no need to convert to XAML first, you can use the WPF primitives directly. Of course it would be great if it were builtin, I think UWP has support, it would be great if post-3.0 WPF could be updated to be at least on par with what UWP supports.
GIF is just an image format, it should already work through normal image sources/brushes/drawings given there's an appropriate decoder (I think there is but didn't check), or do you mean GIF animations? If there is no GIF decoder or if you want animations please open a separate issue.
@weltkante The "great if it were builtin" bit of your post is exactly the reason I made this issue. It's baffling that WPF didn't come with SVG support out of the box.
I also agree, however what about other things with the SVG loader as well? Like for example if the SVG has paths specifying a specific color embedded in the svg data but you want to have the loader substitute that color with another one (take RebeccaPurple to replace black for example)?
That does svg to xaml, which this issue is trying to avoid the need to do such thing.
Also the conversion to xaml is not always the best option because what if it also includes hidden paths from the svg image and displays them in your wpf code?
As such I am considering this might be the better option to bring into WPF built in eventually: https://github.com/dotnetprojects/SVGImage
SVG is a perfect match for WPF, but there's no way to display one without either using a third party library or converting it to XAML.