Error processing SSI file
LEADTOOLS Svg (Leadtools.Svg assembly)

Show in webframe

LoadFromMemory Method






Buffer containing the SVG data.
0-based offset into the buffer where the data begins.
Number of bytes to read.
Options to use during load. If this parameter is null, then a default SvgLoadOptions object will be used.
Creates an SvgDocument object from data saved in a memory buffer.
Syntax
public static SvgDocument LoadFromMemory( 
   byte[] buffer,
   int offset,
   int length,
   SvgLoadOptions options
)
'Declaration
 
Public Shared Function LoadFromMemory( _
   ByVal buffer() As Byte, _
   ByVal offset As Integer, _
   ByVal length As Integer, _
   ByVal options As SvgLoadOptions _
) As SvgDocument
'Usage
 
Dim buffer() As Byte
Dim offset As Integer
Dim length As Integer
Dim options As SvgLoadOptions
Dim value As SvgDocument
 
value = SvgDocument.LoadFromMemory(buffer, offset, length, options)
- (nullable instancetype)initWithData:(NSData *)data
                              options:(nullable LTSvgLoadOptions *)options
                                error:(NSError **)error
            
public static SvgDocument loadFromMemory(byte[] buffer, int offset, int length, SvgLoadOptions options)

Parameters

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.

Return Value

The SvgDocument object this method creates.
Remarks

To get and set information about the document's bounds and resolution, refer to SVG Size, Bounds and Flat.

Example
Copy Code  
Imports Leadtools
Imports Leadtools.Codecs
Imports Leadtools.Drawing
Imports Leadtools.Forms.DocumentWriters
Imports Leadtools.Svg

Public Shared Sub SvgLoadFromMemoryExample()
   ' Assume the SVG file is located here
   Dim srcFileName As String = Path.Combine(Common.ImagesPath.Path, "Page1.svg")
   ' Load the file into memory
   Dim data() As Byte = File.ReadAllBytes(srcFileName)

   ' Load the SVG
   Using document As SvgDocument = SvgDocument.LoadFromMemory(data, 0, data.Length, Nothing)
      ' Prepare it
      If Not document.IsFlat Then
         document.Flat(Nothing)
      End If
      If Not document.Bounds.IsValid Then
         document.CalculateBounds(False)
      End If

      ' Show its properties
      Console.WriteLine("Bounds: " + document.Bounds.Bounds.ToString())
      Console.WriteLine("Resolution: " + document.Bounds.Resolution.ToString())
   End Using
End Sub
using Leadtools;
using Leadtools.Codecs;
using Leadtools.Drawing;
using Leadtools.Forms.DocumentWriters;
using Leadtools.Svg;

      
public void SvgLoadFromMemoryExample()
{
   // Assume the SVG file is located here
   string srcFileName = Path.Combine(ImagesPath.Path, "Page1.svg");
   // Load the file into memory
   byte[] data = File.ReadAllBytes(srcFileName);

   // Load the SVG
   using (SvgDocument document = SvgDocument.LoadFromMemory(data, 0, data.Length, null))
   {
      // Prepare it
      if (!document.IsFlat)
         document.Flat(null);
      if (!document.Bounds.IsValid)
         document.CalculateBounds(false);

      // Show its properties
      Console.WriteLine("Bounds: " + document.Bounds.Bounds);
      Console.WriteLine("Resolution: " + document.Bounds.Resolution);
   }
}
Requirements

Target Platforms

See Also

Reference

SvgDocument Class
SvgDocument Members

Error processing SSI file
  Leadtools.Svg requires a Document or Medical toolkit license and unlock key. For more information, refer to: LEADTOOLS Toolkit Features