原創(chuàng)|使用教程|編輯:張瑩心|2021-10-27 15:41:05.243|閱讀 238 次
概述:幻燈片切換是在從一張幻燈片導(dǎo)航到另一張幻燈片時(shí)顯示的效果。這些增強(qiáng)了演示文稿的外觀和感覺(jué),并使它們更具吸引力。在某些情況下,可能需要以編程方式將幻燈片切換添加到 PowerPoint 文件。為此,本文將教您如何使用 C++ 向 PowerPoint 幻燈片添加過(guò)渡。
# 界面/圖表報(bào)表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
幻燈片切換是在從一張幻燈片導(dǎo)航到另一張幻燈片時(shí)顯示的效果。這些增強(qiáng)了演示文稿的外觀和感覺(jué),并使它們更具吸引力。在某些情況下,可能需要以編程方式將幻燈片切換添加到 PowerPoint 文件。為此,本文將教您如何使用 C++ 向 PowerPoint 幻燈片添加過(guò)渡。
>>你可以點(diǎn)擊這里下載Aspose.Slides 最新版測(cè)試體驗(yàn)。
Aspose.Slides for C++ 是一個(gè)用于處理 PowerPoint 文件的 C++ API。它無(wú)需安裝 Microsoft PowerPoint 即可創(chuàng)建、閱讀和更新 PowerPoint 文件。此外,該 API 允許向 PowerPoint 演示文稿添加幻燈片過(guò)渡。
// 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);
以下是使用 C++ 向幻燈片添加高級(jí)過(guò)渡的步驟。
// 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);
在演示文稿中使用變形過(guò)渡來(lái)制作幻燈片之間的平滑過(guò)渡動(dòng)畫(huà)。以下部分介紹了如何在 Microsoft PowerPoint 中以及如何使用 C++ 以編程方式添加變形過(guò)渡。
以下是在 Microsoft PowerPoint 中添加變形過(guò)渡的步驟。
// 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);
如果你想試用Aspose的全部完整功能,可聯(lián)系在線客服獲取30天臨時(shí)授權(quán)體驗(yàn)。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請(qǐng)務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請(qǐng)郵件反饋至chenjj@fc6vip.cn