ShapeCollection

ShapeCollection

Overview

ShapeCollection is a class in Aspose.Cells FOSS for .NET.

Represents collection of drawing objects (shapes) on a worksheet. Shapes include various drawing elements such as rectangles, circles, arrows, text boxes, and connectors. They can be used for visual annotations, highlighting, or creating diagrams within worksheets. Shapes support multiple geometry types and can be positioned using anchor coordinates. Each shape can be independently configured with different types and properties. var workbook = new Workbook(); var worksheet = workbook.Worksheets[0]; // Add different shapes worksheet.Shapes.Add(5, 5, 7, 7, AutoShapeType.Rectangle); worksheet.Shapes.Add(9, 5, 11, 7, AutoShapeType.Ellipse); worksheet.Shapes.Add(13, 5, 15, 7, AutoShapeType.RightArrow); Console.WriteLine($“Added {worksheet.Shapes.Count} shapes”);

This class provides 2 methods for working with ShapeCollection objects in .NET programs. Available methods include: Add, RemoveAt. All exported members are accessible to any .NET application after installing the Aspose.Cells FOSS for .NET package. Properties: Count.

Description

ShapeCollection is a class in the Aspose.Cells FOSS library for .NET that exposes 2 methods and 1 property for programmatic use.

The class also provides the Count property (gets the count).

Properties

NameTypeAccessDescription
CountintReadGets the count.

Methods

SignatureDescription
Add(upperLeftRow: int, upperLeftColumn: int, lowerRightRow: int, lowerRightColumn: int, shapeType: AutoShapeType)The type of shape to add.
RemoveAt(index: int)Removes the shape at the specified zero-based index.

See Also