ReaderSvgRead Method |
Name | Description | |
---|---|---|
Read(Stream) |
Reads svg file from stream - useful for reading svg files from resources. The file is read as Shapes (Canvas, Path, Ellipse, etc.).
| |
Read(String) |
Reads svg or svgz file from file system or from online source. The file is read as Shapes (Canvas, Path, Ellipse, etc.).
|
The following sample loads the mySample.svg file and adds it to the myStackPanel.
Viewbox sampleViewbox = Ab2d.ReaderSvg.Instance.Read(@"c:\mySample.svg");
myStackPanel.Children.Add(sampleViewbox);
The following sample loads the mySample.svg file from web site.
Ab2d.ReaderSvg myReaderSvg = new Ab2d.ReaderSvg(); Viewbox sampleViewbox = myReaderSvg.Read(@"http://www.myWeb.com/test/mySample.svg"); myStackPanel.Children.Add(sampleViewbox);
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);