Bestimmen, ob Shape eine Smart Art Shape ist mit C++
Contents
[
Hide
]
Mögliche Verwendungsszenarien
SmartArt-Formen sind spezielle Formen in Microsoft Excel, die es ermöglichen, automatisch komplexe Diagramme zu erstellen. Sie können feststellen, ob es sich um eine SmartArt-Form oder um eine normale Form handelt, indem Sie die Eigenschaft Shape.IsSmartArt verwenden.
Feststellen, ob eine Form ein SmartArt-Form ist
Der folgende Beispielcode lädt die Beispieldatei Excel, die eine SmartArt-Form enthält, wie in diesem Screenshot gezeigt. Anschließend wird der Wert der Shape.IsSmartArt-Eigenschaft der ersten Form ausgegeben. Bitte beachten Sie die Konsolenausgabe des folgenden Beispielcodes.
Beispielcode
#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
using namespace Aspose::Cells::Drawing;
int main()
{
Aspose::Cells::Startup();
// Load the sample smart art shape - Excel file
U16String inputFilePath(u"sampleSmartArtShape.xlsx");
Workbook wb(inputFilePath);
// Access first worksheet
WorksheetCollection sheets = wb.GetWorksheets();
Worksheet ws = sheets.Get(0);
// Access first shape
ShapeCollection shapes = ws.GetShapes();
Shape sh = shapes.Get(0);
// Determine if shape is smart art
std::cout << "Is Smart Art Shape: " << sh.IsSmartArt() << std::endl;
Aspose::Cells::Cleanup();
}
Konsolenausgabe
Is Smart Art Shape: True