Lottie Windows
v8.1.240821.1
Lottie-Windows是一個庫,用於在您的應用程序中呈現Adobe After After Effects動畫。該項目將窗口添加到洛蒂(Lottie)的工具家族中,也針對Android,iOS和Web。
Lottie simplifies the design-to-code workflow for bringing engaging, interactive vector animations to your Windows applications, with significant improvements in terms of performance, quality, and engineering efficiency over traditional approaches such as gifs, manually coded animations, etc. Lottie-Windows uses the Windows.UI.Composition APIs to provide smooth 60fps animations and resolution-independent vector graphics.

Lottie-Windows由3種相關產品組成:
此存儲庫還包含樣本的源代碼。
將Lottie動畫集成到Winui 3或UWP項目中有兩種選擇。
選項#1,使用動態加載器
CommunityToolkit.WinUI.Lottie nuget軟件包,用於winui項目(或UWP項目的CommunityToolkit.Uwp.Lottie )。Microsoft.Graphics.Win2D (1.0.5或以下版本)安裝Winui Project(或Win2D.uwp和Microsoft.UI.Xaml )進行UWP項目。.xaml標記文件中添加: ...
xmlns:lottie="using:CommunityToolkit.WinUI.Lottie"
...
< AnimatedVisualPlayer >
< lottie : LottieVisualSource UriSource = " <asset path or web link to a json file> " />
</ AnimatedVisualPlayer > ...
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:lottie="using:CommunityToolkit.Uwp.Lottie"
...
< muxc : AnimatedVisualPlayer >
< lottie : LottieVisualSource UriSource = " <asset path or web link to a json file> " />
</ muxc : AnimatedVisualPlayer >選項#2,使用Codegen(推薦)
dotnet tool install lottiegenlottiegen -InputFile MyAnimation.json -Language cs -WinUIVersion 3-WinUIVersion 2.X具體取決於Microsoft.UI.Xaml的版本cppwinrt和cppcx.xaml標記文件中添加: ...
xmlns:animatedvisuals="using:AnimatedVisuals"
...
< AnimatedVisualPlayer >
< animatedvisuals : MyAnimation />
</ AnimatedVisualPlayer > ...
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:animatedvisuals="using:AnimatedVisuals"
...
< muxc : AnimatedVisualPlayer >
< animatedvisuals : MyAnimation />
</ muxc : AnimatedVisualPlayer >| 包裹 | 分支 | 地位 | 最新的Nuget版本 |
|---|---|---|---|
| communityToolkit.winui.lottie | 主要的 | ||
| communityToolkit.uwp.lottie | 主要的 | ||
| 洛蒂根 | 主要的 |
請使用GitHub問題進行錯誤報告和功能請求。
該項目採用了貢獻者盟約定義的行為準則,以闡明我們社區的預期行為。有關更多信息,請參見.NET基金會行為守則。
該項目得到了.NET基金會的支持。