Skip to main content

SetBackground

Sets the background to the current presentation slide.

Syntax

expression.SetBackground(oApiFill);

expression - A variable that represents a ApiSlide class.

Parameters

NameRequired/OptionalData typeDefaultDescription
oApiFillRequiredApiFillThe color or pattern used to fill the presentation slide background.

Returns

boolean

Example

Set a background fill for a slide.

// Apply a radial gradient fill to the slide background.

// Add the slide to the presentation with the new background.

const presentation = Api.GetPresentation();
const slide = Api.CreateSlide();
const gs1 = Api.CreateGradientStop(Api.RGB(255, 213, 191), 0);
const gs2 = Api.CreateGradientStop(Api.RGB(255, 111, 61), 100000);
const fill = Api.CreateRadialGradientFill([gs1, gs2]);
slide.SetBackground(fill);
presentation.AddSlide(slide);