Arbeiten mit der ThreeDFormat von Shape oder Diagramm mit C++
Contents
[
Hide
]
Mögliche Verwendungsszenarien
Aspose.Cells bietet die Shape.ThreeDFormat Eigenschaft zusammen mit der ThreeDFormat Klasse, um mit dem 3D-Format von Formen oder Diagrammen zu arbeiten. Die ThreeDFormat Klasse enthält verschiedene Eigenschaften, die gesetzt werden können, um unterschiedliche Ergebnisse je nach Anwendungsanforderung zu erzielen.
Arbeiten mit dem ThreeDFormat von Shape oder Diagramm
Der folgende Beispielcode lädt die Quelldatei Excel und greift auf die erste Shape in der ersten Tabelle zu. Es setzt dann die Untereigenschaften der Shape.ThreeDFormat Eigenschaft und speichert die Arbeitsmappe in der Ausgabedatei Excel.
#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
using namespace Aspose::Cells::Drawing;
int main()
{
Aspose::Cells::Startup();
// Source directory path
U16String srcDir(u"..\\Data\\01_SourceDirectory\\");
// Output directory path
U16String outDir(u"..\\Data\\02_OutputDirectory\\");
// Path of input excel file
U16String inputFilePath = srcDir + u"sample.xlsx";
// Path of output excel file
U16String outputFilePath = outDir + u"output_out.xlsx";
// Load excel file containing a shape
Workbook wb(inputFilePath);
// Access first worksheet
Worksheet ws = wb.GetWorksheets().Get(0);
// Access first shape
Shape sh = ws.GetShapes().Get(0);
// Apply different three dimensional settings
ThreeDFormat n3df = sh.GetThreeDFormat();
n3df.SetContourWidth(17);
n3df.SetExtrusionHeight(32);
// Save the output excel file in xlsx format
wb.Save(outputFilePath);
std::cout << "3D settings applied successfully!" << std::endl;
Aspose::Cells::Cleanup();
}