Экспорт диаграммы
Contents
[
Hide
]
Получить изображение диаграммы
Aspose.Slides для 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
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/ChartImage_out.png"; | |
//Instantiate Presentation class that represents PPTX file | |
SharedPtr<Presentation> pres = MakeObject<Presentation>(); | |
//Access first slide | |
SharedPtr<ISlide> slide = pres->get_Slides()->idx_get(0); | |
// Add chart with default data | |
SharedPtr<IChart> chart = slide->get_Shapes()->AddChart(Aspose::Slides::Charts::ChartType::ClusteredColumn, 0, 0, 500, 500); | |
//Generate chart image | |
auto bitmap = chart->GetThumbnail(); | |
bitmap->Save(outPath, ImageFormat::get_Png()); | |