PresentationPlayer

PresentationPlayer clase

Representa el reproductor de animaciones asociado con el Presentation.

public class PresentationPlayer : IDisposable

Constructores

NameDescription
PresentationPlayer(PresentationAnimationsGenerator, double)Crea una nueva instancia de PresentationPlayer.

Propiedades

NameDescription
FrameIndex { get; }Obtiene el índice del fotograma.

Métodos

NameDescription
Dispose()Descarta la instancia de PresentationPlayer.

Otros miembros

NameDescription
delegate FrameTickHandlerRepresenta el controlador de tics de fotograma del evento FrameTick.

Ejemplos

[C#]
using (Presentation pres = new Presentation("pres.pptx"))
{
    using (var animationsGenerator = new PresentationAnimationsGenerator(pres))
    {
        // Reproducir animación a 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);
        }
        
        // Reproducir animación a 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);
        }
    }
}

Ver también