[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.Drawing.IShapes

IShapes Interface

Represents a collection of all IShape objects on a worksheet.

This interface provides access to drawing objects on the specified sheet, including shapes, charts, pictures, and connectors. It supports adding new drawing objects, retrieving individual shapes by index or name, creating shape range (IShapeRange) subsets, and iterating through the collection.

Namespace: GrapeCity.Documents.Excel.Drawing
Assembly: DS.Documents.Excel.dll
Syntax
public interface IShapes : IEnumerable<IShape>, IEnumerable
Public Interface IShapes
    Inherits IEnumerable(Of IShape), IEnumerable
Examples
IShapes shapes = worksheet.Shapes;
IShape titleShape = shapes.AddShape(AutoShapeType.Rectangle, 20, 20, 120, 40);
titleShape.TextFrame.TextRange.Text = "Sales";
IShape sameShape = shapes[0];

Properties

Name Description
Count

Gets the number of IShape objects in this collection.

Use this property to get the current number of IShape objects in the IShapes collection for a worksheet.

this[int]

Gets the IShape at the specified index in this collection.

this[string]

Gets the IShape with the specified name from this collection.

Range

Returns a IShapeRangeProvider object that receives parameters of the Range property.

Methods

Name Description
AddCameraPicture(string, IRange)

Creates a camera picture from a reference range and places it in the specified target range on the current sheet.

The worksheet that contains targetRange must be the same worksheet that owns this IShapes collection. The returned picture is positioned and sized to match the specified target range.

AddCameraPicture(string, double, double)

Creates a camera picture from a reference range and places it at the specified position.

Returns the IShape object that represents the new picture. The left and top parameters specify the placement position in points.

AddCameraPicture(string, double, double, double, double)

Creates a camera picture from a reference range.

Returns the IShape object that represents the new picture. The picture is placed at the specified position and sized using point units.

AddCameraPicture(string, string, IRange)

Creates a camera picture from a referenced source range and places it in the specified target range on the current sheet.

A camera picture is a dynamic linked picture of the referenced range. The sheet of the target targetRange and the sheet to which the shape is added must be the same sheet.

AddCameraPicture(string, string, double, double)

Creates a camera picture from a reference range and places it at the specified position.

The returned picture is generated from the source range and remains linked to that range. Use name to assign a name to the created picture.

AddCameraPicture(string, string, double, double, double, double)

Creates a camera picture from a reference range and places it at the specified position and size.

The returned picture is generated from the source range and remains linked to that range. Use name to assign a name to the created picture.

AddChart(ChartType, IRange)

Creates a chart at the specified range on the current sheet.

The sheet of the target range and the sheet to which the shape is added must be the same sheet.

AddChart(ChartType, double, double, double, double)

Creates a chart at the specified location on the active sheet.

Use the position and size arguments, in points, to place the chart on the worksheet. The returned IShape contains the chart and can be used to access the chart through Chart.

AddChart(string, ChartType, IRange)

Creates a chart at the specified range on the current sheet.

The sheet of targetRange and the sheet to which the shape is added must be the same sheet.

AddChart(string, ChartType, double, double, double, double)

Creates a chart at the specified location on the active sheet.

Use this method to add a chart shape with an explicit name and size. The position and size are measured in points. After the chart is created, use Chart to configure its data series and other chart settings.

AddChartInPixel(ChartType, double, double, double, double)

Creates a chart at the specified location on the active sheet.

This method positions the chart by using pixel-based coordinates and size values. The returned IShape represents the newly created chart shape.

AddChartInPixel(string, ChartType, double, double, double, double)

Creates a chart with the specified name at the specified location on the active sheet.

The chart position and size are measured in pixels.

AddConnector(ConnectorType, IRange)

Creates a connector at the specified range on the current sheet.

The sheet of targetRange and the sheet of the shape being added must be the same sheet.

AddConnector(ConnectorType, double, double, double, double)

Creates a connector and returns the IShape object that represents the new connector.

The connector's starting and end points are specified in points relative to the upper-left corner of the document.

AddConnector(string, ConnectorType, IRange)

Creates a connector at the specified range on the current sheet.

The sheet of targetRange and the sheet where the shape is added must be the same sheet. Returns the IShape object that represents the new connector.

AddConnector(string, ConnectorType, double, double, double, double)

Creates a connector and returns the IShape object that represents the new connector.

Use this method to add a connector by specifying the coordinates of its starting and end points. The coordinate values are measured in points relative to the upper-left corner of the document.

AddConnectorInPixel(ConnectorType, double, double, double, double)

Creates a connector and returns the IShape object that represents the new connector.

This method uses pixel-based coordinates for the connector's starting and ending points, relative to the upper-left corner of the document.

AddConnectorInPixel(string, ConnectorType, double, double, double, double)

Creates a connector and returns the IShape object that represents the new connector.

This method uses pixel-based coordinates for the connector's starting and ending points, relative to the upper-left corner of the document.

AddPicture(Stream, ImageType, IRange)

Creates a picture from an existing stream at the specified range on the current sheet.

The sheet of targetRange and the sheet of the shape being added must be the same sheet. Returns the IShape object that represents the new picture.

AddPicture(Stream, ImageType, double, double, double, double)

Creates a picture from an existing stream.

Returns the IShape object that represents the new picture.

AddPicture(string, IRange)

Creates a picture from an existing file at the specified range on the current sheet.

The worksheet of targetRange and the worksheet that receives the new shape must be the same.

AddPicture(string, double, double, double, double)

Creates a picture from an existing file and returns the IShape object that represents the new picture.

Use this method to place a picture at a specific position on the current sheet. The left and top values are measured in points relative to the upper-left corner of the document.

AddPicture(string, Stream, ImageType, IRange)

Creates a picture from an existing stream at the specified range on the current sheet.

The worksheet of targetRange and the worksheet to which the shape is added must be the same. Returns the IShape object that represents the new picture.

AddPicture(string, Stream, ImageType, double, double, double, double)

Creates a picture from an existing stream.

Returns the IShape object that represents the new picture.

AddPicture(string, string, IRange)

Creates a picture from an existing file at the specified range on the current sheet.

The worksheet of targetRange and the worksheet that receives the new shape must be the same.

AddPicture(string, string, double, double, double, double)

Creates a picture from an existing file and adds it to the worksheet at the specified position and size.

The picture is positioned in points relative to the upper-left corner of the document.

AddPictureInPixel(Stream, ImageType, double, double, double, double)

Creates a picture from an existing stream. Returns the IShape object that represents the new picture.

The picture is positioned and sized by the destination rectangle specified in pixels relative to the upper-left corner of the document.

AddPictureInPixel(string, double, double, double, double)

Creates a picture from an existing file and returns the IShape object that represents the new picture.

The picture is positioned and sized by the destination rectangle specified in pixels relative to the upper-left corner of the document.

AddPictureInPixel(string, Stream, ImageType, double, double, double, double)

Creates a picture with the specified name from an existing stream. Returns the IShape object that represents the new picture.

The picture is positioned and sized by the destination rectangle specified in pixels relative to the upper-left corner of the document.

AddPictureInPixel(string, string, double, double, double, double)

Creates a picture from an existing file. Returns the IShape object that represents the new picture.

Use this method to insert a picture at the specified position and size, with all coordinates and dimensions measured in pixels.

AddShape(AutoShapeType, IRange)

Returns the IShape object that represents the new preset shape at the specified range on the current sheet.

The sheet of targetRange and the sheet of the shape being added must be the same sheet.

AddShape(AutoShapeType, double, double, double, double)

Adds a new preset shape to the worksheet and returns the created IShape object.

The shape is created at the specified position and size, measured in points relative to the upper-left corner of the document.

AddShape(string, AutoShapeType, IRange)

Returns the IShape object that represents the new preset shape at the specified range on the current sheet.

The sheet of targetRange and the sheet to which the shape is being added must be the same sheet.

AddShape(string, AutoShapeType, double, double, double, double)

Returns the IShape object that represents the new preset shape in a worksheet.

Creates a preset shape with the specified name, type, position, and size. The shape name can be used to retrieve the created shape from the worksheet's shape collection.

AddShapeInPixel(AutoShapeType, double, double, double, double)

Creates a new preset shape in the worksheet using pixel-based position and size.

This method returns the IShape object that represents the new preset shape. The specified pixel values are converted to points before the shape is created.

AddShapeInPixel(string, AutoShapeType, double, double, double, double)

Creates a preset shape with the specified name at the specified location on the worksheet.

The shape position and size are measured in pixels. The left and top values specify the position of the upper-left corner of the preset shape's boundary box relative to the upper-left corner of the document.