Is there a way to add image to smart art in powerpoint through aspos slides?
Hi,
Thanks for your interest in Aspose.Slides.
I have observed the requirement shared by you and like to sggest you to try using following code to serve the purpsoe. However, I am getting Argument exception while setting smart art fill type to Picture. I have created a ticket with ID SLIDESNET-34485 in our issue tracking system to further investigate and resolve the issue. Once the issue will be resolved, you will be using following sample code to serve the purpose.
public static void addSmartArtImage(){//Instantiate the presentationPresentationEx pres = new PresentationEx();//Access the presentation slideSlideEx slide = pres.Slides[0];//Instantiate the ImageEx classSystem.Drawing.Image img = (System.Drawing.Image)new Bitmap(@“C:\Users\Public\Pictures\Sample Pictures\Desert.jpg”);ImageEx imgx = pres.Images.AddImage(img);//Add Smart Art ShapeSmartArtEx smart = slide.Shapes.AddSmartArt(0, 0, 400, 400, SmartArtLayoutTypeEx.BasicBlockList);smart.FillFormat.FillType = FillTypeEx.Picture;smart.FillFormat.PictureFillFormat.Picture.Image = imgx;//Saving presentationpres.Save(“D\Aspose Data\SimpleSmartArt.pptx”, Aspose.Slides.Export.SaveFormat.Pptx);}
Many Thanks,