Free Support Forum - aspose.com

Retrieving bacground image from PPTX

Hi

I have tryed to retrieve a background image from this presentation. But I can’t. I have null value for ImageEx in all PictureEx instances for backround and theme.

Can anyone help me with this?

Hi Mobius,

Thanks for your interest in Aspose.Slides.

What I could understand, you want to extract images on your content slides that are inherited from the master slide and appear as background images on content slides. Here is the sample code to retrieve such images and further save to disk:

PresentationEx pres = new PresentationEx("Company+Meeting+Josh+S4B.pptx");

MasterSlideEx msld= pres.Masters[0];

int num = 1;

foreach (ShapeEx shp in msld.Shapes)

{

if (shp is PictureFrameEx)

{

PictureFrameEx pf=(PictureFrameEx)shp;

ImageEx img= pf.PictureFormat.Picture.Image;

img.Image.Save("img" + num + ".jpg", ImageFormat.Jpeg);

num = num + 1;

}

}

Hope this will be hopeful.

Best Regards

Yep! Thanks!