ShapeCollection

ShapeCollection

Overview

ShapeCollection is a class in Aspose.Slides FOSS for .NET. Inherits from: IShapeCollection.

Represents an ordered, mutable collection of objects belonging to a slide or group shape. Wraps the <p:spTree> XML element and provides lazy-loaded, cache-backed access to shape wrappers.

Properties

NameTypeAccessDescription
ParentGroupIGroupShape?Read
AsICollectionIList<IShape>ReadGets the collection as an IList of IShape
AsIEnumerableIEnumerable<IShape>ReadGets the collection as an IEnumerable of IShape
CountintRead

Methods

SignatureDescription
ShapeCollection()
ToArray()Returns a sub‑array of shapes starting at startIndex
ToArray(startIndex: int, count: int)
Reorder(index: int, shape: IShape)Moves multiple shapes to start at the given index
Reorder(index: int, shapes: IShape[])
AddAutoShape(shapeType: ShapeType, x: float, y: float, width: float, height: float)Adds a new AutoShape of the given type and dimensions
AddAutoShape(shapeType: ShapeType, x: float, y: float, width: float, height: float, createFromTemplate: bool)
InsertAutoShape(index: int, shapeType: ShapeType, x: float, y: float, width: float, height: float)Inserts a new AutoShape at index, optionally from a template
InsertAutoShape(index: int, shapeType: ShapeType, x: float, y: float, width: float, height: float, createFromTemplate: bool)
AddConnector(shapeType: ShapeType, x: float, y: float, width: float, height: float)Adds a connector, optionally from a template
AddConnector(shapeType: ShapeType, x: float, y: float, width: float, height: float, createFromTemplate: bool)
InsertConnector(index: int, shapeType: ShapeType, x: float, y: float, width: float, height: float)Inserts a connector at the given index
InsertConnector(index: int, shapeType: ShapeType, x: float, y: float, width: float, height: float, createFromTemplate: bool)
AddPictureFrame(shapeType: ShapeType, x: float, y: float, width: float, height: float, image: IPPImage)Adds a picture frame with the supplied image
InsertPictureFrame(index: int, shapeType: ShapeType, x: float, y: float, width: float, height: float, image: IPPImage)Inserts a picture frame at index with the supplied image
AddTable(x: float, y: float, columnWidths: double[], rowHeights: double[])Adds a table at position with specified column widths and row heights
InsertTable(index: int, x: float, y: float, columnWidths: double[], rowHeights: double[])Inserts a table at index with given dimensions
IndexOf(shape: IShape)Returns the zero‑based index of the specified shape
RemoveAt(index: int)Removes the shape at the given index
Remove(shape: IShape)Removes the specified shape from the collection
Clear()
GetEnumerator()Returns an enumerator for iterating the shapes

See Also