This project has moved and is read-only. For the latest updates, please go here.

load SVG from (memory)-stream?

Topics: SVG, WPF and GDI+ Renderers
Jun 1, 2011 at 12:31 PM

hi there,

is it possible to load a SVG from stream? i just found the source property which wants a (url) string, but i load my images from database.

Thanks a lot for your help.


Jun 1, 2011 at 12:43 PM

Yes, it can load from stream/textreader/file etc. 

There is, however, no way it can resolve the image in database. You will have to provide the resolver to work for this case.

Best regards,

Jun 1, 2011 at 2:46 PM


thanks for your answer.

im now using the SharpVectors.Renderers.Forms.SvgPictureBox class to display SVGs. but i couldnt find a way to load the SVG from a memorystream to the SvgPictureBox. 

For testing i was now loading the SVG via .SourceURL Property from my harddisk.

But how can i set the SVG via MemoryStream? which interface/classes do i have to use?

thanks a lot!


Jun 1, 2011 at 3:46 PM

The GDI+ renderer is currently less complete in this library - efforts are mostly focussed WPF.

We never thought there was a demand for GDI+ version until now, and now we are planning to
rework it on the version 2.0. 

For the GDI+ the SvgDocument instance, which opens the document is hidden in the SvgPictureBoxWindow, which
is accessible through a read-only property in the SvgPictureBox.

The way out is to add more methods to the SvgPictureBox and SvgPictureBoxWindow to match the corresponding
methods in SvgDocument. Unfortunately, we are planning further feature implementation for the GDI+ in version 1.0,
so please test your files to see if this renderer meets your needs. Then I can expose more methds for you.

Best regards,