Hello.
Since Aspose.Svg can already use Skia engine, is there a possibility to somehow render directly to SKCanvas instead of rendering to PNG beforehand?
Our WPF software (SCADA system) loads svg in memory, updates some elements properties regularly, and then renders it to the screen (via Skia Canvas Control). I’ve been using Svg.Skia library so far, it works, but has some hiccups with unsupported properties, incorrect bounds and a few more.
I’m evaluating Aspose.Svg right now, and I’m most certainly impressed with DOM tree built, every attribute is transparent, most of the API resembles SVG specs. No mistakes in rendering, bounds, etc.
I’ve managed to render to screen successfully, but still not happy enough with the performance. Right now I have to do something like this:
using (var bitmapStream = new MemoryStream())
using (var device = new ImageDevice(options, bitmapStream))
{
_svgDocument.RenderTo(device);
bitmapStream.Seek(0, SeekOrigin.Begin);
_skBitmap = SKBitmap.Decode(bitmapStream);
}
...
canvas.DrawBitmap(_skBitmap, 0, 0);
But it’s certainly an overhead to encode to PNG, then to decode back to SKBitmap.
Svg.Skia allowed me to use SKPictureRecorder to render the document on the underlying canvas, then to just expose the resulting SKPicture.
If there is some way to access Skia internals when working with the Svg document, it would drastically improve the performance for my (and maybe others) application.