プレゼンテーションの作成 - C++ PowerPoint API
Contents
[
Hide
]
PowerPointプレゼンテーションの作成
選択したスライドにシンプルなラインを追加するには、以下の手順に従ってください:
- Presentation クラスのインスタンスを作成します。
- インデックスを使用してスライドの参照を取得します。
- Shapesオブジェクトが公開するAddAutoShapeメソッドを使用して、ラインタイプのAutoShapeを追加します。
- 修正したプレゼンテーションを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
For complete examples and data files, please go to https://github.com/aspose-slides/Aspose.Slides-for-C | |
// The path to the documents directory. | |
const String outPath = u"../out/SampleChartresult.pptx"; | |
//Instantiate Presentation class that represents PPTX file | |
SharedPtr<Presentation> pres = MakeObject<Presentation>(); | |
SharedPtr<ISlide> slide = pres->get_Slides()->idx_get(0); | |
// Add an autoshape of type line | |
slide->get_Shapes()->AddAutoShape(Aspose::Slides::ShapeType::Line, 50.0, 150.0, 300.0, 0.0); | |
//Saving presentation | |
pres->Save(outPath, Aspose::Slides::Export::SaveFormat::Pptx); | |