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

    Specifies the maximum nesting depth of elements in an SVG image.

    Namespace: DevExpress.Utils.Svg

    Assembly: DevExpress.Data.v26.1.dll

    NuGet Package: DevExpress.Data

    Declaration

    public static int MaxElementDepth { get; set; }

    Property Value

    Type Description
    Int32

    The maximum nesting depth of elements. The default value is DefaultMaxElementDepth (64). 0 disables the limit.

    Remarks

    If an image nests elements deeper than the limit, the application does not load the image and throws an SvgImageLimitsExceededException. The SvgImageLimitsExceededException.Kind property returns SvgImageLimitKind.ElementDepth.

    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 or disable this limit, an image with deeply nested elements may terminate the application process with a StackOverflowException.

    using DevExpress.Utils.Svg;
    
    // Call at application startup.
    SvgImageLimits.MaxElementDepth = 32;
    

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

    See Also