I have observed the sample code shared by you and like to share that you are only adding the images in presentation picture collection and not in any shapes to make them visible. Please visit this documentation link for your kind reference.
Thank you very much for the reply. Now I am able to see my slide in the file. But when I open the file, I always get an dialog saying that file is corrupted would you like to repair it. Is this common or am I doing something wrong. I have following code
I have observed the sample code shared and there seems to be no issue in it. Can you please share the generated presentation along with PowerPoint version where you have obtained the issue. Please also share the sample image that you are adding on your end. I will try to reproduce the same on my end. I hope you will be using Aspose.Slides for .NET 7.1.0 on your end.
For sample I am using a graph as my image: http://cricages.com/wp-content/uploads/bar-graph.gif
Also I am using Power Point 2010. I have attached the generated .PPTX for your reference and using Aspose.Slides for .NET File version 4.2.0.0
Also when you click on the repair you can see the image is not in the center of the image, can you tell me how to achieve this.
Thanks for sharing the gif image. I have used the following sample code for adding the gif image to slide using Aspose.Slides for .NET 7.1.0 and have not been able to reproduce the issue on my end. For your kind reference, I have attached the generated presentation as well. Please try using the specified version on your end and hopefully things will work.
I am able to open the attached file without any warning. I got a trial license for .NET 7.1.0 and tries the same process. Still I am getting same repair dialog when I save the PPT file.
I will try again. Also could you please tell me how to center the image in the slide.
I have attached the sample project for your kind reference that I have developed using Aspose.Slides for .NET 7.1.0 on my end. Secondly, I have also added the logic for setting the image to center of slide as well. You can please use that as reference and can change that accordingly as per your needs.