Shapes
Collect.Shapes method
收集Shape
中的所有实例Presentation
.
public static IEnumerable<Shape> Shapes(Presentation pres)
范围 | 类型 | 描述 |
---|---|---|
pres | Presentation | 用于收集形状的演示 |
返回值
所有形状的集合包含在演示文稿中
例子
using (Presentation pres = new Presentation("pres.pptx"))
{
foreach (Shape shape in Collect.Shapes(pres))
{
// 如果形状是自选图形,添加黑色实心边框
if (shape is AutoShape autoShape)
{
autoShape.LineFormat.Style = LineStyle.Single;
autoShape.LineFormat.Width = 10f;
autoShape.LineFormat.FillFormat.FillType = FillType.Solid;
autoShape.LineFormat.FillFormat.SolidFillColor.Color = Color.Black;
}
}
pres.Save("pres-out.pptx", SaveFormat.Pptx);
}
也可以看看
- class Shape
- class Presentation
- class Collect
- 命名空间 Aspose.Slides.LowCode
- 部件 Aspose.Slides