Avalonia: Using Lottie in Avalonia

Created on 19 Sep 2018  路  6Comments  路  Source: AvaloniaUI/Avalonia

Recently an opensource Lottie project was released base on WPF + SharpDX and i want to know how we can use it in Avalonia too https://github.com/ascora/LottieSharp
I want to know how we can implement D2dControl for Avalonia
https://github.com/ascora/LottieSharp/blob/master/LottieSharp/WpfSurface/D2dControl.cs

question

All 6 comments

If you stick to the Direct2D1 backend it should be possible to port this to Avalonia. A more decoupled version that supports more backends would make more sense for Avalonia.

@Gillibald It's base on SharpDX now. To make it portable backends it's need to modify lot of things. right?

If they just use Direct2D1 API it would be easier to port this to Avalonia because we kind of expose the RenderTarget API via DrawingContext. Haven't checked the implementation details so I could be wrong.

@Gillibald Another project was released for SkiaSharp https://github.com/yinyue200/LottieSkiaSharp
Now there is 2 separate project exists one for SharpDx and the other SkiaSharp. Do you think is it possible to make it fully compatible with with Avalonia for all platform?

Looks like it is possible to just rewrite the rendering logic to support the Avalonia render pipeline. I would use LottieSkiaSharp as a starting point and just replace all the Skia related stuff with our render backend. That way you get support for all backends like D2D1 and Skia. Shouldn't be that complicated.

It would be better if the potential Lottie port for Avalonia be hooked to our RenderTimers, having a separate timer screws up rendering and is less performant

Was this page helpful?
0 / 5 - 0 ratings

Related issues

RUSshy picture RUSshy  路  4Comments

ZZerker picture ZZerker  路  4Comments

kekekeks picture kekekeks  路  4Comments

khoshroomahdi picture khoshroomahdi  路  4Comments

x2bool picture x2bool  路  4Comments