Hi, so I’m trying to replace a picture on a slide with some other picture and I can’t seem to get it working.
Here is some condensed code to show what I’m trying:
foreach (ShapeEx shp in slds[slds.Count - 1].Shapes)
else if (shp.Name.Contains(“Picture”))
//Set the fill type to Picture
shp.FillFormat.FillType = FillTypeEx.Picture;
//Set the picture fill mode
shp.FillFormat.PictureFillFormat.PictureFillMode = PictureFillModeEx.Stretch;
//Set the picture
System.Drawing.Image img = (System.Drawing.Image)new Bitmap(localizedImage);
ImageEx imgx = srcPres.Images.AddImage(img);
I was following the example posted in the documents section titled Fill ShapesEX with Picture (http://www.aspose.com/docs/display/slidesnet/Filling+ShapesEx+with+Picture)
but the picture doesn’t seem to change.
Using some debugging I found out that This shape in particular is a PictureEx, so I’m not sure how its even entering the foreach loop since every conversion i have tried seems to say you cant cast ShapeEx to PictureEx. Any tips are appreciated.
Thanks in advanced,