Setting the Image as Background to Slides in Python

Aspose.Slides - Setting the Image as Background to Slides

To Set the Image as Background to Slides using Aspose.Slides Java for Python. Here you can see example code.

Python Code

 # Instantiate Presentation class that represents the presentation file

pres = self.Presentation

\# Set the background with Image

backgroundType = self.BackgroundType

fillType = self.FillType

pictureFillMode = self.PictureFillMode




\# Set the picture

imgx = pres.getImages().addImage(self.FileInputStream(self.File(self.dataDir + 'night.jpg')))

\# Image imgx = pres.getImages().addImage(image)

\# Add image to presentation's images collection


\# Saving the presentation

save_format = self.SaveFormat + "ContentBG_Image.pptx", save_format.Pptx)

print "Set image as background, please check the output file."

Download Running Code

Download running code from any of the below mentioned social coding sites: