Free Support Forum - aspose.com

How to get the background image?

If you choose a Powerpoint Slide Design, it automatically puts a background on your slide. How can I get this background as a System.Drawing.Imaging.Image? Right now I am looping through the Presentation.Pictures collection and trying to match the PictureID of each object…but with no success. Is it possible to get the background of a slide into an Image file?

Dear Michael,

Sure, it’s possible.

System.Drawing.Image image = pres.Pictures.GetPictureById(pres.Slides[0].Background.PictureId).Image;

Sorry to revive an old post, but I have this issue as well. I investigated the proposed solution but it doesn’t work. Typically the PictureID for background is 0, and unless I have included other picture boxes, clip art, etc. there are no pictures in the presentation. Maybe if I used a “user defined” background it would work, but with the predefined designs, I haven’t been able to retrieve the background.

most of the predefined designs are gradient fills…so you have to get each color of the gradient (that is if you are trying to recreate that background)

Thanks Michael :slight_smile:

Yes, most of predefined backgrounds in powerpoint are gradients and set of shapes (usualy polylines with some filling).
New hot fix which allows to read polylines will be published tomorrow.

Polyline class contains Points and Segments arrays.
Element of Segments array can be Line or Curve.
Points - set of points. It has start, end and control points of curves to use with DrawBezier method.