Asynchronously determines quickly whether the stream contains SVG data.
public static Task<bool> IsSvgAsync(
this RasterCodecs rasterCodecs,
ILeadStream stream
)
rasterCodecs
RasterCodecs object to perform the operation.
stream
The stream containing the source image data.
A Task
that represents the asynchronous operation. TResult
: true if the data is valid SVG; otherwise, false.
This topic is part of RasterCodecs
support for .NET async/await
support. Refer to RasterCodecs Async Operations for more information.
This method will check the beginning of the stream to determine whether it contains valid SVG data. This involves detecting the value <svg> tag and optionally the SVG namespaces. If this method returns true, then the data is most likely an SVG file and can be safely loaded. Note, however, that the data can possibly contain a corrupted or truncated SVG. In such a case, this method will still return true but subsequent calls to loading the SVG will fail.
For .NET Framework: A reference to the Leadtools.Async.dll assembly is required to use this functionality.
For .NET Standard: This functionality is included in the Leadtools.Codecs.dll assembly.
Target PlatformsHelp Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document