PresentationPlayer

Classe PresentationPlayer

Représente le lecteur d’animations associé au Presentation.

public class PresentationPlayer : IDisposable

Constructeurs

NomDescription
PresentationPlayer(PresentationAnimationsGenerator, double)Crée une nouvelle instance de PresentationPlayer.

Propriétés

NomDescription
FrameIndex { get; }Obtient l’index de la trame.

Méthodes

NomDescription
Dispose()Libère l’instance de PresentationPlayer.

Autres membres

NomDescription
delegate FrameTickHandlerReprésente le gestionnaire de tick de trame de l’événement FrameTick.

Exemples

[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
    using (var animationsGenerator = new PresentationAnimationsGenerator(pres))
    {
        // Lire l'animation à 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);
        }
        
        // Lire l'animation à 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);
        }
    }
}

Voir aussi