ShapeCollection

ShapeCollection

Overview

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

Represents an ordered, mutable collection of IShape objects belonging to a slide or group shape.

This class provides 22 methods for working with ShapeCollection objects in .NET programs. Available methods include: AddAutoShape, AddConnector, AddPictureFrame, AddTable, Clear, GetEnumerator, IndexOf, InsertAutoShape, InsertConnector, InsertPictureFrame, InsertTable, Remove, and 4 additional methods. All public members are accessible to any .NET application after installing the Aspose.Slides FOSS for .NET package. Properties: AsICollection, AsIEnumerable, Count, ParentGroup.

Properties

NameTypeAccessDescription
ParentGroupIGroupShape?ReadGets the parent group.
AsICollectionIList<IShape>ReadGets the as i collection.
AsIEnumerableIEnumerable<IShape>ReadGets the as i enumerable.
CountintReadGets the count.

Methods

SignatureDescription
ShapeCollection()Initializes a new instance of the ShapeCollection class.
ToArray()Returns a sub‑array of shapes starting at startIndex
ToArray(startIndex: int, count: int)Calls ToArray(startIndex, count) on this ShapeCollection instance.
Reorder(index: int, shape: IShape)Moves multiple shapes to start at the given index
Reorder(index: int, shapes: IShape[])Calls Reorder(index, shapes) on this ShapeCollection instance.
AddAutoShape(shapeType: ShapeType, x: float, y: float, width: float, height: float)Creates a new AutoShape of the requested ShapeType at the specified coordinates and returns the shape instance
AddAutoShape(shapeType: ShapeType, x: float, y: float, width: float, height: float, createFromTemplate: bool)Calls AddAutoShape(shapeType, x, y, width, height, createFromTemplate) on this ShapeCollection instance.
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)Calls InsertAutoShape(index, shapeType, x, y, width, height, createFromTemplate) on this ShapeCollection instance.
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)Calls AddConnector(shapeType, x, y, width, height, createFromTemplate) on this ShapeCollection instance.
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)Calls InsertConnector(index, shapeType, x, y, width, height, createFromTemplate) on this ShapeCollection instance.
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()Calls Clear on this ShapeCollection instance.
GetEnumerator()Returns an enumerator for iterating the shapes

See Also