PresentationPlayer

PresentationPlayer class

Represents the player of animations associated with the Presentation.

public class PresentationPlayer : IDisposable

Constructors

NameDescription
PresentationPlayer(PresentationAnimationsGenerator, double)Creates new instance of the PresentationPlayer.

Properties

NameDescription
FrameIndex { get; }Gets the frame index.

Methods

NameDescription
Dispose()Disposes the instance of the PresentationPlayer.

Other Members

NameDescription
delegate FrameTickHandler

Examples

[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
    using (var animationsGenerator = new PresentationAnimationsGenerator(pres))
    {
        // Play animation with 33 FPS
        using (var player = new PresentationPlayer(animationsGenerator, 33))
        {
            player.FrameTick += (sender, args) =>
            {
                args.GetFrame().Save(Path.Combine("33fps", $"frame_{sender.FrameIndex}.png"));
            };

            animationsGenerator.Run(pres.Slides);
        }
        
        // Play animation with 45 FPS
        using (var player = new PresentationPlayer(animationsGenerator, 45))
        {
            player.FrameTick += (sender, args) =>
            {
                args.GetFrame().Save(Path.Combine("45fps", $"frame_{sender.FrameIndex}.png"));
            };

            animationsGenerator.Run(pres.Slides);
        }
    }
}

See Also