You can find detailed information at: Add Slide Transitions in PowerPoint Presentations using C++
Last active
October 15, 2021 14:58
-
-
Save aspose-com-gists/3736d216e71030784785593601cc48fb to your computer and use it in GitHub Desktop.
Add Slide Transitions in PowerPoint Presentations using C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File paths | |
const String sourceFilePath = u"SourceDirectory\\Slides\\SamplePresentation.pptx"; | |
const String outputFilePath = u"OutputDirectory\\AddAdvancedTransition_out.pptx"; | |
// Load the presentation file | |
auto presentation = System::MakeObject<Presentation>(sourceFilePath); | |
// Apply circle type transition on slide 1 | |
presentation->get_Slides()->idx_get(0)->get_SlideShowTransition()->set_Type(Aspose::Slides::SlideShow::TransitionType::Circle); | |
// Set the transition time of 3 seconds | |
presentation->get_Slides()->idx_get(0)->get_SlideShowTransition()->set_AdvanceOnClick(true); | |
presentation->get_Slides()->idx_get(0)->get_SlideShowTransition()->set_AdvanceAfterTime(3000); | |
// Apply comb type transition on slide 2 | |
presentation->get_Slides()->idx_get(1)->get_SlideShowTransition()->set_Type(Aspose::Slides::SlideShow::TransitionType::Comb); | |
// Set the transition time of 5 seconds | |
presentation->get_Slides()->idx_get(1)->get_SlideShowTransition()->set_AdvanceOnClick(true); | |
presentation->get_Slides()->idx_get(1)->get_SlideShowTransition()->set_AdvanceAfterTime(5000); | |
// Save Presentation | |
presentation->Save(outputFilePath, Aspose::Slides::Export::SaveFormat::Pptx); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File paths | |
const String sourceFilePath = u"SourceDirectory\\Slides\\SamplePresentation.pptx"; | |
const String outputFilePath = u"OutputDirectory\\AddMorphTransition_out.pptx"; | |
// Load the presentation file | |
auto presentation = System::MakeObject<Presentation>(sourceFilePath); | |
// Add morph transition | |
presentation->get_Slides()->idx_get(0)->get_SlideShowTransition()->set_Type(Aspose::Slides::SlideShow::TransitionType::Morph); | |
auto morphTransition = System::DynamicCast<Aspose::Slides::SlideShow::IMorphTransition>(presentation->get_Slides()->idx_get(0)->get_SlideShowTransition()->get_Value()); | |
morphTransition->set_MorphType(Aspose::Slides::SlideShow::TransitionMorphType::ByWord); | |
// Save Presentation | |
presentation->Save(outputFilePath, Aspose::Slides::Export::SaveFormat::Pptx); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// File paths | |
const String sourceFilePath = u"SourceDirectory\\Slides\\SamplePresentation.pptx"; | |
const String outputFilePath = u"OutputDirectory\\AddTransition_out.pptx"; | |
// Load the presentation file | |
auto presentation = System::MakeObject<Presentation>(sourceFilePath); | |
// Apply circle type transition on slide 1 | |
presentation->get_Slides()->idx_get(0)->get_SlideShowTransition()->set_Type(Aspose::Slides::SlideShow::TransitionType::Circle); | |
// Apply comb type transition on slide 2 | |
presentation->get_Slides()->idx_get(1)->get_SlideShowTransition()->set_Type(Aspose::Slides::SlideShow::TransitionType::Comb); | |
// Save Presentation | |
presentation->Save(outputFilePath, Aspose::Slides::Export::SaveFormat::Pptx); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment