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

Async load of SVG in SvgCanvas

Topics: SVG, WPF and GDI+ Renderers
Sep 4, 2014 at 9:43 AM
Hi is it possible to load a SVG from uri async? I used the SvgCanvas.Source to set the URI but with large SVG files the UI is locked during the loading time.

Regards,
Sebastian
Coordinator
Oct 12, 2014 at 12:45 PM
Hello Sebastian,
Sorry for the late response. I switched off my PC for sometime now, only using phone and tablet
for the internet access.

In order to support the correct ordering of the elements from the SVG file, it must be rendered
sequentially, at least for simplicity.

The SvgCanvas.Source information is eventually loaded in the SvgCanvas.CreateDrawing() method
using the file converter; FileSvgReader. So an easy way is to add a property for Async loading and
use the FileSvgReader in a background thread if the property is set.

I will try to add that support in the next update. Please remember this project is simply a set
of libraries and the control part is loosely coupled so you can easily duplicate the SvgCanvas for
your own needs. I will really encourage that, since I provided those set of converters and controls
for convenience.

Best regards,
Paul.