Skip to main content
A newer version of this page is available. .

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

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["Fill"] = "#FF0000";
    }
}
See Also