GetFill
获取笔触的填充(颜色)。
语法
expression.GetFill();
expression - 表示 ApiStroke 类的变量。
参数
此方法没有任何参数。
返回值
ApiFill | null
示例
读取演示文稿中应用于边框线的颜色或图案。
// How do I see what color or fill the border has in a presentation?
// Access the fill properties of a stroke to check its appearance in a presentation.
let presentation = Api.GetPresentation();
let slide = presentation.GetSlideByIndex(0);
let fill = Api.CreateSolidFill(Api.CreateRGBColor(255, 200, 100));
let stroke = Api.CreateStroke(2 * 36000, Api.CreateSolidFill(Api.CreateRGBColor(0, 0, 255)));
let shape = Api.CreateShape("rect", 100 * 36000, 50 * 36000, fill, stroke);
shape.SetPosition(2000000, 1000000);
slide.AddObject(shape);
let content = shape.GetDocContent();
let paragraph = content.GetElement(0);
let strokeObj = shape.GetLine();
if (strokeObj) {
let strokeFill = strokeObj.GetFill();
if (strokeFill) {
paragraph.AddText("Stroke fill type: " + strokeFill.GetType());
}
}