Click or drag to resize
AB4D logo

ReaderSvgRead Method (Stream)

Reads svg file from stream - useful for reading svg files from resources. The file is read as Shapes (Canvas, Path, Ellipse, etc.).

Namespace:  Ab2d
Assembly:  Ab2d.ReaderSvg (in Ab2d.ReaderSvg.dll) Version: 7.1.7295.1040
Syntax
C#
public Viewbox Read(
	Stream stream
)

Parameters

stream
Type: System.IOStream
stream to read svg file

Return Value

Type: Viewbox
Viewbox with elements defined in svg file
Examples
The following sample shows how to read svg file from Application's Resource (mySample.svg file is included into the project under cliparts folder and its build action is set to Resource):
Uri uri = new Uri("/cliparts/mySample.svg", UriKind.Relative);
using (Stream svgStream = Application.GetResourceStream(uri).Stream)
{
    clipartFromResource = Ab2d.ReaderSvg.Instance.Read(svgStream);
}

myStackPanel.Children.Add(clipartFromResource);
See Also