I'm using SharpVectors to dynamically convert an svg file to a Drawing which I then display in my GUI. I'm using the following code
public static DrawingBrush CreateBrush(Stream stream)
MemoryStream dummy = new MemoryStream();
var a = new SharpVectors.Converters.StreamSvgConverter(true, false, new SharpVectors.Renderers.Wpf.WpfDrawingSettings());
var b = new DrawingBrush(a.Drawing);
This works but the extents of the drawing only take into account the extents of all of the graphic elements. I'd like to have the brush use the extents of the svg document so if the svg document is a page with just a small graphic in the center that same spacing
is preserved in my conversion. The Bounds of the drawing do the have the correct offset but I can't figure out how to get the correct extents of the document.
Also, is the above code the best way to convert an svg file to a Drawing? It seems excessive since I don't really care about the xaml output and just throw it away.