使用 Aspose.Cells 处理形状或图表的三维格式
Contents
[
Hide
]
可能的使用场景
Aspose.Cells提供了Shape.ThreeDFormat属性以及ThreeDFormat类,用于处理形状或图表的三维格式。 ThreeDFormat类包含可设置的不同属性,以实现应用程序需求的不同效果。
使用 Aspose.Cells 处理形状或图表的三维格式
以下示例代码加载源Excel文件,并访问第一个工作表中的第一个形状,并设置Shape.ThreeDFormat属性的子属性,然后将工作簿保存为输出Excel文件。
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-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Load excel file containing a shape | |
Workbook wb = new Workbook(dataDir + "sample.xlsx"); | |
// Access first worksheet | |
Worksheet ws = wb.Worksheets[0]; | |
// Access first shape | |
Shape sh = ws.Shapes[0]; | |
// Apply different three dimensional settings | |
ThreeDFormat n3df = sh.ThreeDFormat; | |
n3df.ContourWidth = 17; | |
n3df.ExtrusionHeight = 32; | |
// Save the output excel file in xlsx format | |
wb.Save(dataDir + "output_out.xlsx"); |