SvgImage.Clone(Action<SvgElement, Hashtable>) Method

You cannot modify SvgImage objects directly. Instead, you need to create their copies and modify them in process.

Namespace: DevExpress.Utils.Svg

Assembly: DevExpress.Data.v20.2.dll

Declaration

public SvgImage Clone(
    Action<SvgElement, Hashtable> updateStyle
)
Public Function Clone(
    updateStyle As Action(Of SvgElement, Hashtable)
) As SvgImage

Parameters

Name Type Description
updateStyle Action<DevExpress.Utils.Svg.SvgElement, Hashtable>

A Delegate that modifies the icon.

Returns

Type Description
SvgImage

New vector image copy.

Remarks

The code below illustrates how to clone the "sourceImg" icon and re-paint its "Indicator" element.

SvgImage sourceImg = svgImageCollection1[1];
SvgImage modifiedImg = sourceImg.Clone(UpdateStyle);

protected void UpdateStyle(SvgElement element, Hashtable properties)
{
    if (string.Equals(element.Id, "Indicator", StringComparison.OrdinalIgnoreCase))
    {
        element.Styles.Clear();
        hashtable["StyleName"] = string.Empty;
        properties["Fill"] = "#FF0000";
    }
}
See Also