Picture handling



I have a problem. I need to be able to extract all picture from a presentation. Then I manipulate them with a Component that add special effect to the picture, and finally I need to replace the original picture with the modified one.

So far i’ve been able to extract picture, apply my special effect to it. But I dont know how to replace de old one with the new one :

foreach(Aspose.PowerPoint.Picture pic in pres.Pictures)


//Convert to Special Effect Component Image Format

MemoryStream inStream = new MemoryStream();

pic.Image.Save(inStream, pic.ImageFormat);


//Special Effects

//Save file back to stream

MemoryStream outStream = new MemoryStream();

//Create a System.Drawing.Image

pic.image = System.Drawing.Image.FromStream(outStream); // DONT WORK !!!


In fact my pic (Aspose.Powerpoint.Picure) Image is read only property. So I’m not able to save the modified picture…

Is there a way to do that? Did I miss something obvious?


Alkar Durecht
Sersoft SA


Dear Alkar,

It’s not possible to replace picture.
You have to add new picture and after that iterate through all shapes and replace old picture id with new one (FillFormat.PictureId and PictureFrame.PictureId).

I can implement replacing pictures but can’t guarantee correct work in some cases.