Presentation Background

Setting the Background Color to Slides

In this topic, we will see that how can we set the background color of a slide. We know that Aspose.Slides for .NET may contain two types of slides: Master Slide & Normal Slide. It is possible to change the background colors of both types of slides, which will be explained in this topic.

Setting the Background Color of a Master Slide

We know that Aspose.Slides for .NET may contain two types of slides: Master Slide & Normal Slide. It is possible to change the background colors of both types of slides. Master Slide is like a template that contains all formatting settings, which are applied on all other normal slides contained inside the presentation. It means that if you change the background color of the master slide, all normal slides in the presentation would receive the same background color settings. Please follow the steps below to change the background color of the master slide:

  1. Create an instance of Presentation class.
  2. Set the Background Type of the Slide to OwnBackground.
  3. Set the FillType of the Slide Background to Solid.
  4. Set the Background Color of the Master Slide of the presentation to any desired color using the SolidFillColor.Color property exposed by FillFormat object.
  5. Write the modified presentation as a presentation file.

Setting the Background Color of a Normal Slide

A Normal Slide is the one which inherits its format settings from the master slide. If you want to modify its background settings, you would have to modify the slide settings. Please follow the steps below to perform this task:

  • Create an instance of Presentation class.
  • Set the Background Type of the Slide to OwnBackground.
  • Set the FillType of the Slide Background to Solid.
  • Set the Background Color of the Normal Slide of the presentation to any desired color using the SolidFillColor.Color property exposed by FillFormat object.
  • Write the modified presentation as a presentation file.

Setting the Background Color to a Gradient to Slides

Gradient is a graphic effect consisting of a gradual change in color. It is great for creating depth and highlights to sections of the images. It is possible to apply gradient effect on the background of a slide using Aspose.Slides for .NET that will be explained in the remaining discussion of this topic.

Setting simple Gradient effect to Slide Background

To apply the simple gradient effect on the background of a slide using Aspose.Slides for .NET, please follow the steps below:

  • Create an instance of Presentation class.
  • Set the Background Type of the Slide to OwnBackground.
  • Set the FillType of the Slide Background to Gradient.
  • Apply any desired gradient effect from the available options provided by GradientFormatEx object.
  • Write the modified presentation file.

Setting the Image as Background to Slides

Sometimes, developers may need to use an image as the background of the slide. To fulfill such development needs, Aspose.Slides for .NET also allows filling the slide background with any image.

Setting the Slide Background to an Image

To use an image as the background of a slide using Aspose.Slides for .NET, please follow the steps below:

  1. Create an instance of Presentation class.
  2. Set the Background Type of the Slide to OwnBackground.
  3. Set the FillType of the Slide Background FillFormat to Picture.
  4. Set the PictureFillMode using the options provided by PictureFillMode enum.
  5. Instantiate Image class with an image that can be used as source picture for the Slide Background using PictureFillFormat.Picture.Image.
  6. Write the modified presentation file.

Get Effective Background Values Of Slide

Aspose.Slides.IBackgroundEffectiveData interface and its implementation by Aspose.Slides.BackgroundEffectiveData class have been added. They represent effective background of slide and contain information about effective fill format and effective effect format.

CreateBackgroundEffective method has been added to IBaseSlide interface and BaseSlide class. This method allows to get effective values for slides background.

The following code snippet shows how to get effective background values of slide.