优化更新代码,添加界面功能并整合
This commit is contained in:
24
WPFluent/Controls/AnimatedImage/AnimationProvider.cs
Normal file
24
WPFluent/Controls/AnimatedImage/AnimationProvider.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace WPFluent.Controls;
|
||||
|
||||
internal abstract class AnimationProvider : IDisposable
|
||||
{
|
||||
protected AnimationProvider(Uri path)
|
||||
{
|
||||
Path = path;
|
||||
Animator = new();
|
||||
Animator.KeyFrames.Add(new DiscreteInt32KeyFrame(0, KeyTime.FromTimeSpan(TimeSpan.Zero)));
|
||||
}
|
||||
|
||||
public Uri Path { get; }
|
||||
|
||||
public Int32AnimationUsingKeyFrames Animator { get; protected set; }
|
||||
|
||||
public abstract void Dispose();
|
||||
|
||||
public abstract Task<BitmapSource> GetRenderedFrame(int index);
|
||||
}
|
||||
Reference in New Issue
Block a user