跳到主要内容

CreateNoFill

创建无填充并移除元素的填充。

语法

expression.CreateNoFill();

expression - 表示 Api 类的变量。

参数

此方法没有任何参数。

返回值

ApiFill

示例

在文档中创建无填充并移除元素的填充。

// The no-fill object removes any existing fill from the shape stroke.

// Create a stroke with no fill in a document.

let doc = Api.GetDocument();
let paragraph = doc.GetElement(0);
let gs1 = Api.CreateGradientStop(Api.RGB(255, 213, 191), 0);
let gs2 = Api.CreateGradientStop(Api.RGB(255, 111, 61), 100000);
let fill = Api.CreateLinearGradientFill([gs1, gs2], 5400000);
let stroke = Api.CreateStroke(0, Api.CreateNoFill());
let shape = Api.CreateShape("rect", 5930900, 395605, fill, stroke);
paragraph.AddDrawing(shape);