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
Remarks
The application throws this exception when it loads an SVG image that meets one of the following conditions:
- The image nests elements deeper than the SvgImageLimits.MaxElementDepth value.
- The image contains more elements (counted with references) than the SvgImageLimits.MaxElementCount value.
- The image contains a reference cycle.
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.