SetBackground
Sets the background to the current presentation slide.
Syntax
expression.SetBackground(oApiFill);
expression
- A variable that represents a ApiSlide class.
Parameters
Name | Required/Optional | Data type | Default | Description |
---|---|---|---|---|
oApiFill | Required | ApiFill | The color or pattern used to fill the presentation slide background. |
Returns
boolean
Example
This example sets background color of the slide.
- Code
- Result
// How to change a background color of the slide.
// Get a slide by its index, set its background and add it to the presentation.
const presentation = Api.GetPresentation();
const slide = Api.CreateSlide();
const gs1 = Api.CreateGradientStop(Api.CreateRGBColor(255, 213, 191), 0);
const gs2 = Api.CreateGradientStop(Api.CreateRGBColor(255, 111, 61), 100000);
const fill = Api.CreateRadialGradientFill([gs1, gs2]);
slide.SetBackground(fill);
presentation.AddSlide(slide);