Wpf: SVG support for Image.ImageSource

Created on 5 Dec 2018  路  4Comments  路  Source: dotnet/wpf

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.

issue-type-api-suggestion

Most helpful comment

Besides an SvgSource class, it would be awesome to have SvgBrush and SvgDrawing too, etc.

All 4 comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vsfeedback picture vsfeedback  路  3Comments

daniel-white picture daniel-white  路  3Comments

juepiezhongren picture juepiezhongren  路  3Comments

TobiasSekan picture TobiasSekan  路  3Comments

Normandy picture Normandy  路  3Comments