更改形状的调整值
Contents
[
Hide
]
Aspose.Cells for Python via .NET提供Shape.geometry.shape_adjust_values属性,以便对形状的调整点进行更改。在Microsoft Excel界面中,调整显示为黄色菱形节点。例如:
- 圆角矩形有一个调整来改变拱形
- 三角形有一个调整来改变顶点的位置
- 梯形具有一个调整以更改顶部的宽度
- 箭头有两个调整,可改变箭头头部和尾部的形状
本文将解释如何使用 Shape.geometry.shape_adjust_values 属性来更改不同形状的调整值。
以下代码示例显示如何更改形状的调整值。
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
from aspose.cells import Workbook | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Create workbook object from source excel file | |
workbook = Workbook(dataDir + "source.xlsx") | |
# Access first worksheet | |
worksheet = workbook.worksheets[0] | |
# Access first three shapes of the worksheet | |
shape1 = worksheet.shapes[0] | |
shape2 = worksheet.shapes[1] | |
shape3 = worksheet.shapes[2] | |
# Change the adjustment values of the shapes | |
shape1.geometry.shape_adjust_values[0].value = 0.5 | |
shape2.geometry.shape_adjust_values[0].value = 0.8 | |
shape3.geometry.shape_adjust_values[0].value = 0.5 | |
# Save the workbook | |
workbook.save(dataDir + "output_out.xlsx") |