プレゼンテーションの作成 - C++ PowerPoint API

PowerPointプレゼンテーションの作成

選択したスライドにシンプルなラインを追加するには、以下の手順に従ってください:

  1. Presentation クラスのインスタンスを作成します。
  2. インデックスを使用してスライドの参照を取得します。
  3. Shapesオブジェクトが公開するAddAutoShapeメソッドを使用して、ラインタイプのAutoShapeを追加します。
  4. 修正したプレゼンテーションをPPTXファイルとして書き込みます。

以下の例では、プレゼンテーションの最初のスライドにラインを追加しました。

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);