Skip to main content
All docs
V26.1
  • SvgImageLimitsExceededException Class

    An exception that is thrown when the application loads an SVG image that exceeds an SVG image limit or contains a reference cycle.

    Namespace: DevExpress.Utils.Svg

    Assembly: DevExpress.Data.v26.1.dll

    NuGet Package: DevExpress.Data

    Declaration

    public class SvgImageLimitsExceededException :
        SecurityException

    Remarks

    The application throws this exception when it loads an SVG image that meets one of the following conditions:

    Use the Kind property to identify the reason.

    Handle SvgImageLimitsExceededException where the application loads SVG images from untrusted sources (for instance, show a placeholder instead of the image).

    The following example handles the exception when the application loads an SVG image:

    using DevExpress.Utils.Svg;
    
    try {
        SvgImage image = SvgImage.FromStream(stream);
        // Use the image.
    }
    catch(SvgImageLimitsExceededException e) {
        // e.Kind returns SvgImageLimitKind.ElementDepth, ElementCount, or ReferenceCycle.
        // Show a placeholder instead of the image.
    }
    

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

    Inheritance

    See Also