PresentationAnimationsGenerator

PresentationAnimationsGenerator 类

表示 Presentation 中动画的生成器。

public class PresentationAnimationsGenerator : IDisposable

构造函数

名称描述
PresentationAnimationsGenerator(Presentation)创建 PresentationAnimationsGenerator 的新实例。
PresentationAnimationsGenerator(Size)创建 PresentationAnimationsGenerator 的新实例。

属性

名称描述
DefaultDelay { get; set; }获取或设置默认延迟时间[ms]。
ExportedSlides { get; }获取导出幻灯片的数量。
IncludeHiddenSlides { get; set; }获取或设置是否应包括隐藏的幻灯片。

方法

名称描述
Dispose()释放 PresentationAnimationsGenerator 的实例。
Run(IEnumerable<ISlide>)为每个幻灯片运行动画事件生成。
Run(IEnumerable<ISlide>, int, FrameTickHandler)为每个幻灯片运行动画事件生成。

字段

名称描述
readonly FrameSize获取帧大小。

事件

名称描述
event NewAnimation表示已生成新动画的事件。

示例

[C#]
using (Presentation presentation = new Presentation("animated.pptx"))
{
    using (var animationsGenerator = new PresentationAnimationsGenerator(presentation))
    using (var player = new PresentationPlayer(animationsGenerator, 33))
    {
        player.FrameTick += (sender, args) =>
        {
            args.GetFrame().Save($"frame_{sender.FrameIndex}.png");
        };

        animationsGenerator.Run(presentation.Slides);
    }
}

另请参见