更改形状的调整值
Contents
[
Hide
]
Aspose.Cells提供形状.几何.ShapeAdjustValues属性来更改形状的调整点。在 Microsoft Excel UI 中,调整显示为黄色菱形节点。例如:
- 圆角矩形有个调整改变圆弧
- 三角形有一个调整改变点的位置
- 梯形有个调整可以改变顶部的宽度
- 箭头有两个调整来改变头部和尾部的形状
本文将解释使用形状.几何.ShapeAdjustValues属性改变不同形状的调整值。
下面的代码示例显示了如何更改形状的调整值。
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); | |
// Create workbook object from source excel file | |
Workbook workbook = new Workbook(dataDir + "source.xlsx"); | |
// Access first worksheet | |
Worksheet worksheet = workbook.Worksheets[0]; | |
// Access first three shapes of the worksheet | |
Shape shape1 = worksheet.Shapes[0]; | |
Shape shape2 = worksheet.Shapes[1]; | |
Shape shape3 = worksheet.Shapes[2]; | |
// Change the adjustment values of the shapes | |
shape1.Geometry.ShapeAdjustValues[0].Value = 0.5d; | |
shape2.Geometry.ShapeAdjustValues[0].Value = 0.8d; | |
shape3.Geometry.ShapeAdjustValues[0].Value = 0.5d; | |
// Save the workbook | |
workbook.Save(dataDir + "output_out.xlsx"); |