跳到主要内容

SetBackground

设置当前幻灯片母版的背景。

语法

expression.SetBackground(oApiFill);

expression - 表示 ApiMaster 类的变量。

参数

名称必需/可选数据类型默认值描述
oApiFill必需ApiFill用于填充演示文稿幻灯片母版背景的颜色或图案。

返回值

boolean

示例

此示例设置当前幻灯片母版的背景。

// How to set a background of a slide master.

// Create a solid fill and apply it as a background for a slide master.

const presentation = Api.GetPresentation();
const slide = presentation.GetSlideByIndex(0);
slide.RemoveAllObjects();

const master = presentation.GetMaster(0);
master.ClearBackground();
const fill = Api.CreateSolidFill(Api.RGB(255, 111, 61));
master.SetBackground(fill);