PresentationAnimationsGenerator

PresentationAnimationsGenerator class

表示演示文稿中的动画生成器 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);
    }
}

另请参阅