IPresentationAnimationPlayer

public interface IPresentationAnimationPlayer

Represents a player of the animation.


Presentation presentation = new Presentation("animated.pptx");
 try {
     PresentationAnimationsGenerator animationsGenerator = new PresentationAnimationsGenerator(presentation.getSlideSize().getSize());
     {
         animationsGenerator.setNewAnimation(animationPlayer -> {
             System.out.println(String.format("Animation total duration: %f", animationPlayer.getDuration()));
             animationPlayer.setTimePosition(0);
             animationPlayer.getFrame().save("firstFrame.png");

             animationPlayer.setTimePosition(animationPlayer.getDuration());
             animationPlayer.getFrame().save("lastFrame.png");
         });
         animationsGenerator.run(presentation.getSlides());
     }
 } finally {
     if (presentation != null) presentation.dispose();
 }

Animations generated by PresentationAnimationsGenerator via its PresentationAnimationsGenerator.NewAnimation event.

Methods

MethodDescription
getDuration()Get animation duration [ms]
setTimePosition(double time)Set the animation time position within the Duration (#getDuration.getDuration).
getFrame()Get the frame for the current time position previously set with the #setTimePosition(double).setTimePosition(double) method.

getDuration()

public abstract double getDuration()

Get animation duration [ms]

Returns: double

setTimePosition(double time)

public abstract void setTimePosition(double time)

Set the animation time position within the Duration (#getDuration.getDuration).

Parameters:

ParameterTypeDescription
timedoubleTime position.

getFrame()

public abstract IImage getFrame()

Get the frame for the current time position previously set with the #setTimePosition(double).setTimePosition(double) method.

Returns: IImage - Frame image