24 lines
597 B
C#
24 lines
597 B
C#
using Telerik.WinControls;
|
|
using Telerik.WinControls.Svg;
|
|
|
|
namespace Pilz.UI.Telerik.Extensions;
|
|
|
|
public static class RadSvgImageExtensions
|
|
{
|
|
public static Image ToImage(this RadSvgImage svg)
|
|
{
|
|
return svg.Document.Draw(svg.Width, svg.Height);
|
|
}
|
|
|
|
public static void ApplyColor(this RadSvgImage svg, Color color)
|
|
{
|
|
svg.Document.Fill = new SvgColourServer(color);
|
|
svg.Document.ApplyRecursive(e =>
|
|
{
|
|
e.Fill = new SvgColourServer(color);
|
|
e.Stroke = new SvgColourServer(color);
|
|
});
|
|
svg.ClearCache();
|
|
}
|
|
}
|