Slide Transition
Contents
[
Hide
]
This article demonstrates applying slide transition effects and timings with Aspose.Slides for .NET.
Add a Slide Transition
Apply a fade transition effect to the first slide.
static void AddSlideTransition()
{
using var presentation = new Presentation();
var slide = presentation.Slides[0];
// Apply a fade transition.
slide.SlideShowTransition.Type = TransitionType.Fade;
}
Access a Slide Transition
Read the transition type currently assigned to a slide.
static void AccessSlideTransition()
{
using var presentation = new Presentation();
var slide = presentation.Slides[0];
slide.SlideShowTransition.Type = TransitionType.Push;
// Access the transition type.
var type = slide.SlideShowTransition.Type;
}
Remove a Slide Transition
Clear any transition effect by setting the type to None.
static void RemoveSlideTransition()
{
using var presentation = new Presentation();
var slide = presentation.Slides[0];
slide.SlideShowTransition.Type = TransitionType.Fade;
// Remove transition by setting none.
slide.SlideShowTransition.Type = TransitionType.None;
}
Set Transition Duration
Specify how long the slide is displayed before advancing automatically.
static void SetTransitionDuration()
{
using var presentation = new Presentation();
var slide = presentation.Slides[0];
slide.SlideShowTransition.AdvanceOnClick = true;
slide.SlideShowTransition.AdvanceAfterTime = 2000; // in milliseconds
}