Excel.PictureFormat enum
图像的格式。
注解
示例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/excel/44-shape/shape-images.yaml
await Excel.run(async (context) => {
const sheet = context.workbook.worksheets.getItem("Shapes");
const shape = sheet.shapes.getItem("Image");
const result = shape.getAsImage(Excel.PictureFormat.png);
await context.sync();
const imageString = result.value;
// Your add-in would save this string as a .png file.
console.log("The image's Base64-encoded string: " + imageString);
});
字段
bmp = "BMP" | 位图图像。 |
gif = "GIF" | 图形交换格式。 |
jpeg = "JPEG" | 联合摄影专家组。 |
png = "PNG" | 可移植网络图形。 |
svg = "SVG" | 可缩放矢量图形。 |
unknown = "UNKNOWN" |