public static SvgDocument LoadFromMemory(byte[] buffer,int offset,int length,SvgLoadOptions options)
Public Shared Function LoadFromMemory( _ByVal buffer() As Byte, _ByVal offset As Integer, _ByVal length As Integer, _ByVal options As SvgLoadOptions _) As SvgDocument
- (nullable instancetype)initWithData:(NSData *)dataoptions:(nullable LTSvgLoadOptions *)optionserror:(NSError **)error
public static SvgDocument loadFromMemory(byte[] buffer, int offset, int length, SvgLoadOptions options) public:static SvgDocument^ LoadFromMemory(array<byte>^ buffer,int offset,int length,SvgLoadOptions^ options)
buffer
Buffer containing the SVG data.
offset
0-based offset into the buffer where the data begins.
length
Number of bytes to read.
options
Options to use during load. If this parameter is null, then a default SvgLoadOptions object will be used.
The SvgDocument object this method creates.
To get and set information about the document's bounds and resolution, refer to SVG Size, Bounds and Flat.
using Leadtools;using Leadtools.Codecs;using Leadtools.Drawing;using Leadtools.Forms.DocumentWriters;using Leadtools.Svg;using LeadtoolsExamples.Common;public void SvgLoadFromMemoryExample(){// Assume the SVG file is located herestring srcFileName = Path.Combine(ImagesPath.Path, "Page1.svg");// Load the file into memorybyte[] data = File.ReadAllBytes(srcFileName);// Load the SVGusing (SvgDocument document = SvgDocument.LoadFromMemory(data, 0, data.Length, null)){// Prepare itif (!document.IsFlat)document.Flat(null);if (!document.Bounds.IsValid)document.CalculateBounds(false);// Show its propertiesConsole.WriteLine("Bounds: " + document.Bounds.Bounds);Console.WriteLine("Resolution: " + document.Bounds.Resolution);}}
Imports LeadtoolsImports Leadtools.CodecsImports Leadtools.DrawingImports Leadtools.Forms.DocumentWritersImports Leadtools.SvgPublic Shared Sub SvgLoadFromMemoryExample()' Assume the SVG file is located hereDim srcFileName As String = Path.Combine(Common.ImagesPath.Path, "Page1.svg")' Load the file into memoryDim data() As Byte = File.ReadAllBytes(srcFileName)' Load the SVGUsing document As SvgDocument = SvgDocument.LoadFromMemory(data, 0, data.Length, Nothing)' Prepare itIf Not document.IsFlat Thendocument.Flat(Nothing)End IfIf Not document.Bounds.IsValid Thendocument.CalculateBounds(False)End If' Show its propertiesConsole.WriteLine("Bounds: " + document.Bounds.Bounds.ToString())Console.WriteLine("Resolution: " + document.Bounds.Resolution.ToString())End UsingEnd Sub
Help 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
