I have an existing Windows icon (.ico) file, that I would like to use in a WPF application. Are there any good tools for converting an .ico icon to an XAML Path Geometry?

有帮助吗?

解决方案

XAML Paths are a vector format and ICOs are bitmaps, so a simple conversion isn't possible.

You could try to open the ICO in a vector software like Inkscape, outline it with Paths then export it as XAML.

If the path is not a requirement, you can also use the .ico in the WPF application directly: simply set it as an Image's Source.

<Image Source="test.ico"/>
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top