IPresentationAnimationPlayer

IPresentationAnimationPlayer interface

Represents a player of the animation. Animations generated by PresentationAnimationsGenerator via its NewAnimation event.

public interface IPresentationAnimationPlayer

Properties

NameDescription
Duration { get; }Get animation duration [ms]

Methods

NameDescription
GetFrame()Get the frame for the current time position previously set with the SetTimePosition method.
SetTimePosition(double)Set the animation time position within the Duration.

Examples

[C#]
using (Presentation presentation = new Presentation("animated.pptx"))
{
    using (var animationsGenerator = new PresentationAnimationsGenerator(presentation.SlideSize.Size.ToSize()))
    {
        animationsGenerator.NewAnimation += animationPlayer =>
        {
            Console.WriteLine($"Animation total duration: {animationPlayer.Duration}");
            
            animationPlayer.SetTimePosition(0);
            animationPlayer.GetFrame().Save("firstFrame.png");
            
            animationPlayer.SetTimePosition(animationPlayer.Duration);
            animationPlayer.GetFrame().Save("lastFrame.png");
      };
        
        animationsGenerator.Run(presentation.Slides);
    }
}

See Also