add_auto_shape方法

add_auto_shape(self, type, upper_left_row, top, upper_left_column, left, height, width)

向工作表添加自选图形。

返回

一个 Shape 对象。


def add_auto_shape(self, type, upper_left_row, top, upper_left_column, left, height, width):
    ...
范围类型描述
typeAutoShapeType自动形状类型。
upper_left_rowint左上行索引。
topint表示 Shape 距离其左行的垂直偏移量,以像素为单位。
upper_left_columnint左上角的列索引。
leftint表示 Shape 距离其左列的水平偏移量,以像素为单位。
heightint表示Shape的高度,以像素为单位。
widthint表示Shape的宽度,以像素为单位。

注意事项

类型不能是 Chart/Comment/Picture/OleObject/Polygon/DialogBox

例子

from aspose.cells.drawing import AutoShapeType

# Adds a AutoShape to the worksheet.
autoShape = shapes.add_auto_shape(AutoShapeType.CUBE, 1, 0, 1, 0, 100, 50)

也可以看看