PresentationPlayer

Classe PresentationPlayer

Représente le lecteur des animations associées à la 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 l’image.

Méthodes

NomDescription
Dispose()Dispose l’instance de PresentationPlayer.

Autres Membres

NomDescription
délégué FrameTickHandler

Exemples

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