Get Started
Documentation

SetBackground

SetBackground(oFill)

Set the background to the current presentation slide.

Parameters:

Name Type Description
oFill ApiFill The color or pattern used to fill the presentation slide background.

Example

Copy code
builder.CreateFile("pptx");
var oPresentation = Api.GetPresentation();
oPresentation.SetSizes(254 * 36000, 190 * 36000);
var oSlide = oPresentation.GetCurrentSlide();
oSlide.RemoveAllObjects();
oGs1 = Api.CreateGradientStop(Api.CreateRGBColor(255, 224, 204), 0);
oGs2 = Api.CreateGradientStop(Api.CreateRGBColor(255, 164, 101), 100000);
oFill = Api.CreateRadialGradientFill([oGs1, oGs2]);
oSlide.SetBackground(oFill);
builder.SaveFile("pptx", "SetBackground.pptx");
builder.CloseFile();

Resulting document