ShapeCollection

ShapeCollection

概述

ShapeCollection 是 Aspose.Slides FOSS 中用于 Python 的一个类。继承自:BaseCollection,IShapeCollection。

表示形状的集合。

此类提供 18 个方法,用于在 Python 程序中处理 ShapeCollection 对象。可用的方法包括:__init__、add_auto_shape、add_chart、add_connector、add_group_shape、add_picture_frame、add_table、clear、index_of、insert_auto_shape、insert_chart、insert_connector,以及另外 6 个方法。安装 Aspose.Slides FOSS for Python 包后,所有公共成员对任何 Python 应用程序均可访问。属性:as_i_collection、as_i_enumerable、length、parent_group。

属性

名称类型访问描述
parent_groupIGroupShape读取获取形状集合的父组形状对象。
as_i_collectionlist读取获取 as i 集合。
as_i_enumerableAny读取获取集合作为 IEnumerable。
lengthint读取返回元素的数量。

方法

签名描述
__init__()初始化一个空的形状集合。
to_array() → list[IShape]将集合转换为数组。
reorder()重新排序集合中的形状。
add_auto_shape() → IAutoShape向集合中添加一个新的 IAutoShape
insert_auto_shape() → IAutoShape在特定位置插入一个新的 IAutoShape
add_connector() → IConnector向集合中添加一个新的 IConnector 形状
insert_connector() → IConnector在给定索引处插入一个新的 IConnector
add_group_shape() → IGroupShape向集合中添加一个新的 GroupShape。
index_of(shape: IShape) → int返回指定形状的零基索引。
add_picture_frame(shape_type, x, y, width, height, image) → IPictureFrame添加一个具有给定类型、位置、大小和图像的 IPictureFrame
insert_picture_frame(index, shape_type, x, y, width, height, image) → IPictureFrame在索引处插入一个具有给定参数的 IPictureFrame
add_chart()在幻灯片中添加图表。
insert_chart()在特定索引处插入图表。
add_table(x, y, column_widths, row_heights) → ITable在位置添加一个 ITable,并设置列宽和行高
insert_table(index, x, y, column_widths, row_heights) → ITable在索引处插入一个 ITable,并设置位置和尺寸
remove_at(index: int)在指定的索引处删除形状。
remove(shape: IShape)从集合中删除指定的形状。
clear()从集合中删除所有形状。

另请参阅

 中文