Crear Presentación - API de PowerPoint en C++
Contents
[
Hide
]
Crear Presentación de PowerPoint
Para agregar una línea sencilla a una diapositiva seleccionada de la presentación, por favor sigue los pasos a continuación:
- Crea una instancia de la clase Presentation.
- Obtén la referencia de una diapositiva utilizando su índice.
- Agrega un AutoShape de tipo Línea utilizando el método AddAutoShape expuesto por el objeto Shapes.
- Escribe la presentación modificada como un archivo PPTX.
En el ejemplo dado a continuación, hemos agregado una línea a la primera diapositiva de la presentación.
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); | |