add_shape方法

add_shape(type, upper_left_row, top, upper_left_column, left, height, width)

将形状添加到工作表。

返回

形状对象。

def add_shape(self, type, upper_left_row, top, upper_left_column, left, height, width):
    ...
范围类型描述
typeMsoDrawingTypeMso 绘图类型。
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 MsoDrawingType

# Add a shape of the specified type
shapeByType = shapes.add_shape(MsoDrawingType.CELLS_DRAWING, 1, 0, 1, 0, 100, 50)

也可以看看