ShapeCollection
内容
[
隐藏
]ShapeCollection class
表示工作表/图表中的所有形状。
public class ShapeCollection : CollectionBase<Shape>
特性
| 姓名 | 描述 |
|---|---|
| Capacity { get; set; } | |
| Count { get; } | |
| Item { get; } | 获取特定索引处的形状对象。 (2 indexers) |
| Item { get; set; } |
方法
| 姓名 | 描述 |
|---|---|
| AddActiveXControl(ControlType, int, int, int, int, int, int) | 创建一个 Activex 控件。 |
| AddArc(int, int, int, int, int, int) | 将 ArcShape 添加到工作表。 |
| AddAutoShape(AutoShapeType, int, int, int, int, int, int) | 将自选图形添加到工作表。 |
| AddAutoShapeInChart(AutoShapeType, int, int, int, int) | 将自选图形添加到图表中。 |
| AddButton(int, int, int, int, int, int) | 向工作表添加一个按钮。 |
| AddCheckBox(int, int, int, int, int, int) | 在工作表中添加一个复选框。 |
| AddComboBox(int, int, int, int, int, int) | 将 ComboBox 添加到工作表中。 |
| AddCopy(Shape, int, int, int, int) | 将形状添加并复制到工作表中。 |
| AddFreeFloatingShape(MsoDrawingType, int, int, int, int, byte[], bool) | 向工作表添加自由浮动形状。仅适用于线条/图像形状。 |
| AddGroupBox(int, int, int, int, int, int) | 将 GroupBox 添加到工作表中。 |
| AddIcons(int, int, int, int, int, int, byte[], byte[]) | 添加 svg 图像。 |
| AddLabel(int, int, int, int, int, int) | 向工作表添加标签。 |
| AddLabelInChart(int, int, int, int) | 向图表添加标签。 |
| AddLine(int, int, int, int, int, int) | 将 LineShape 添加到工作表中。 |
| AddLinkedPicture(int, int, int, int, string) | 添加链接图片。 |
| AddListBox(int, int, int, int, int, int) | 将列表框添加到工作表中。 |
| AddOleObject(int, int, int, int, int, int, byte[]) | |
| AddOleObjectWithLinkedImage(int, int, int, int, string) | 添加链接图片。 |
| AddOval(int, int, int, int, int, int) | 在工作表中添加一个椭圆形。 |
| AddPicture(int, int, int, int, Stream) | 将图片添加到集合中。 |
| AddPicture(int, int, Stream, int, int) | 将图片添加到集合中。 |
| AddPictureInChart(int, int, Stream, int, int) | 将图片添加到图表中。 |
| AddRadioButton(int, int, int, int, int, int) | 将 RadioButton 添加到工作表中。 |
| AddRectangle(int, int, int, int, int, int) | 将 RectangleShape 添加到工作表。 |
| AddScrollBar(int, int, int, int, int, int) | 将滚动条添加到工作表。 |
| AddShape(MsoDrawingType, int, int, int, int, int, int) | 将形状添加到工作表。 |
| AddShapeInChart(MsoDrawingType, PlacementType, int, int, int, int) | 向图表添加形状。所有单位为图表区域的 1/4000。 |
| AddShapeInChart(MsoDrawingType, PlacementType, int, int, int, int, byte[]) | 向图表添加形状。所有单位为图表区域的 1/4000。 |
| AddShapeInChartByScale(MsoDrawingType, PlacementType, double, double, double, double) | 向图表添加形状。所有单位都是图表区域的百分比比例。 |
| AddShapeInChartByScale(MsoDrawingType, PlacementType, double, double, double, double, byte[]) | 向图表添加形状。所有单位为图表区域的 1/4000。 |
| AddSpinner(int, int, int, int, int, int) | 将微调器添加到工作表。 |
| AddSvg(int, int, int, int, int, int, byte[], byte[]) | 添加 svg 图像。 |
| AddTextBox(int, int, int, int, int, int) | 在工作表中添加一个文本框。 |
| AddTextBoxInChart(int, int, int, int) | 向图表添加一个文本框。 |
| AddTextEffect(MsoPresetTextEffect, string, string, int, bool, bool, int, int, int, int, int, int) | 插入艺术字对象。 |
| AddTextEffectInChart(MsoPresetTextEffect, string, string, int, bool, bool, int, int, int, int) | 将艺术字对象插入图表 |
| AddWordArt(PresetWordArtStyle, string, int, int, int, int, int, int) | 自 Excel 2007.s 添加预设艺术字 |
| BinarySearch(Shape) | |
| BinarySearch(Shape, IComparer<Shape>) | |
| BinarySearch(int, int, Shape, IComparer<Shape>) | |
| Clear() | 清除所有形状。 (2 methods) |
| Contains(Shape) | |
| CopyCommentsInRange(ShapeCollection, CellArea, int, int) | 复制范围内的所有评论。 |
| CopyInRange(ShapeCollection, CellArea, int, int, bool) | 将范围内的形状复制到目标范围。 |
| CopyTo(Shape[]) | |
| CopyTo(Shape[], int) | |
| CopyTo(int, Shape[], int, int) | |
| DeleteInRange(CellArea) | 删除范围内的形状。注释形状不会被删除。 |
| DeleteShape(Shape) | 删除一个形状。如果形状在组中或者是评论形状,则不会被删除。 |
| Exists(Predicate<Shape>) | |
| Find(Predicate<Shape>) | |
| FindAll(Predicate<Shape>) | |
| FindIndex(Predicate<Shape>) | |
| FindIndex(int, Predicate<Shape>) | |
| FindIndex(int, int, Predicate<Shape>) | |
| FindLast(Predicate<Shape>) | |
| FindLastIndex(Predicate<Shape>) | |
| FindLastIndex(int, Predicate<Shape>) | |
| FindLastIndex(int, int, Predicate<Shape>) | |
| GetEnumerator() | |
| Group(Shape[]) | 对形状进行分组。 |
| IndexOf(Shape) | |
| IndexOf(Shape, int) | |
| IndexOf(Shape, int, int) | |
| LastIndexOf(Shape) | |
| LastIndexOf(Shape, int) | |
| LastIndexOf(Shape, int, int) | |
| Remove(Shape) | 移除形状。 |
| RemoveAt(int) | 移除形状。 (2 methods) |
| Ungroup(GroupShape) | 取消组合形状项目。 |
| UpdateSelectedValue() | 通过形状的链接单元格的值更新所选值。 |
例子
[C#]
//实例化一个工作簿对象
Workbook workbook = new Workbook();
//获取形状集合
ShapeCollection shapes = workbook.Worksheets[0].Shapes;
//做你的事
//保存excel文件。
workbook.Save("result.xlsx");
也可以看看
- class CollectionBase<T>
- class Shape
- 命名空间 Aspose.Cells.Drawing
- 部件 Aspose.Cells