Skip to main content
All docs
V26.1
  • SvgImageLimits.MaxReferenceDepth Property

    Specifies the maximum depth of nested references that the SVG renderer follows.

    Namespace: DevExpress.Utils.Svg

    Assembly: DevExpress.Data.v26.1.dll

    NuGet Package: DevExpress.Data

    Declaration

    public static int MaxReferenceDepth { get; set; }

    Property Value

    Type Description
    Int32

    The maximum depth of nested references. The default value is DefaultMaxReferenceDepth (16). 0 disables the limit.

    Remarks

    The SVG renderer follows references from <use> elements, fill/stroke="url(#id)", and clip-path="url(#id)". The renderer does not follow references deeper than the limit and renders the image partially. In this instance, the renderer writes the following warning to trace listeners: “The SVG image is rendered partially: …”.

    The limit applies to the entire process. Set the property once at application startup, before the application loads SVG images.

    Warning

    Raise or disable this limit only if all SVG images in your application come from trusted sources. If you raise this value, deeply nested references may exhaust the thread stack and cause an InsufficientExecutionStackException.

    using DevExpress.Utils.Svg;
    
    // Call at application startup.
    SvgImageLimits.MaxReferenceDepth = 8;
    

    For additional information, refer to the following help topic: SVG Image Limits.

    See Also