跳到主要内容

CreateNoFill

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

语法

expression.CreateNoFill();

expression - 表示 Api 类的变量。

参数

此方法没有任何参数。

返回值

ApiFill

示例

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

// How to create the ApiNoFill object and applies it to the shape stroke.

// Creates a stroke with no fill.

// How to create the ApiStroke object with no fill and apply it to the shape.

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);