ElinamLLC / SharpVectors

SharpVectors - SVG# Reloaded: SVG DOM and Rendering in C# for the .Net.
https://elinamllc.github.io/SharpVectors/
BSD 3-Clause "New" or "Revised" License
719 stars 136 forks source link

Change color of svgImage at runtime #250

Closed bergsteinne closed 1 year ago

bergsteinne commented 1 year ago

Hello,

Is it possible to change the color of an svg in svgImage at runtime in wpf?

Best,

paulushub commented 1 year ago

For monochrome yes, see the SvgIcon samples in WpfTestResourceSvg.

bergsteinne commented 1 year ago

Thank you, one question regarding SvgIcon: In the samples you refer to, the source is set via <![CDATA[

Could I do the same and set the source of the SvgIcon to a svg file?

paulushub commented 1 year ago

Could I do the same and set the source of the SvgIcon to a svg file?

Yes, it supports both SvgSource and UriSource properties similar to other controls.

bergsteinne commented 1 year ago

Thanks - sorry for the newbie question but how would the xaml def. be for UriSource to a local file using SvgIcon?

paulushub commented 1 year ago

In the same file you will see controls using "Source", this is the same as "UriSource". The "Source" is maintained for backward compatibility.