Skip to main content

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.v24.1.dll

NuGet Package: DevExpress.Data

Declaration

public SvgImage Clone(
    Action<SvgElement, Hashtable> updateStyle
)

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();
        properties["StyleName"] = string.Empty;
        properties["Fill"] = "#FF0000";
    }
}
See Also