PowerPoint.ShapeFillType enum

指定形状的填充类型。

注解

[ API 集:PowerPointApi 1.4 ]

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/get-set-shapes.yaml

// Changes the selected shapes fill color to red.
await PowerPoint.run(async (context) => {
  const shapes: PowerPoint.ShapeScopedCollection = context.presentation.getSelectedShapes();
  const shapeCount = shapes.getCount();
  shapes.load("items/fill/type");
  await context.sync();
  shapes.items.map((shape) => {
    const shapeFillType = shape.fill.type as PowerPoint.ShapeFillType;
    console.log(`Shape ID ${shape.id} original fill type: ${shapeFillType}`);
    shape.fill.setSolidColor("red");
  });
  await context.sync();
});

字段

gradient = "Gradient"

指定形状应具有渐变填充。

noFill = "NoFill"

指定形状应没有填充。

pattern = "Pattern"

指定形状应具有图案填充。

pictureAndTexture = "PictureAndTexture"

指定形状应具有图片或纹理填充。

slideBackground = "SlideBackground"

指定形状应具有幻灯片背景填充。

solid = "Solid"

指定形状应具有常规实心填充。