## ShapeCollection.AddShape method

将形状添加到工作表。

```csharp
public Shape AddShape(MsoDrawingType type, int upperLeftRow, int top, int upperLeftColumn, 
    int left, int height, int width)
```

| 范围 | 类型 | 描述 |
| --- | --- | --- |
| type | MsoDrawingType | Mso 绘图类型。 |
| upperLeftRow | Int32 | 左上行索引。 |
| top | Int32 | 表示 Shape 与其左行的垂直偏移量，以像素为单位。 |
| upperLeftColumn | Int32 | 左上列索引。 |
| left | Int32 | 表示 Shape 与其左列的水平偏移量，以像素为单位。 |
| height | Int32 | 表示Shape的高度，以像素为单位。 |
| width | Int32 | 表示Shape的宽度，以像素为单位。 |

### 返回值

形状对象。

### 评论

类型不能是 Chart/Comment/Picture/OleObject/Polygon/DialogBox

### 例子

```csharp

[C#]
//添加指定类型的形状
Shape shapeByType = shapes.AddShape(MsoDrawingType.CellsDrawing, 1, 0, 1, 0, 100, 50);
```

### 也可以看看

* class [Shape](../../shape)
* enum [MsoDrawingType](../../msodrawingtype)
* class [ShapeCollection](../../shapecollection)
* 命名空间 [Aspose.Cells.Drawing](../../shapecollection)
* 部件 [Aspose.Cells](../../../)

<!-- DO NOT EDIT: generated by xmldocmd for Aspose.Cells.dll -->
