Hello;
We encounter a problem when inserting an image in PPTX document.
I would create a new slide based on slide mask. I used this code to set picture in existing a shape
public void setShapePicture(Presentation doc, ILayoutSlide layoutSlide, string shapeName, System.Drawing.Image image)
{
var logo_shape = layoutSlide.Shapes.SingleOrDefault(r => r.Name.Equals(shapeName));
IPPImage imgx = doc.Images.AddImage(image);
//Add Picture Frame with height and width equivalent of Picture
logo_shape.FillFormat.FillType = FillType.Picture;
// Set the picture fill mode
logo_shape.FillFormat.PictureFillFormat.PictureFillMode = PictureFillMode.Stretch;
// Set the picture
logo_shape.FillFormat.PictureFillFormat.Picture.Image = imgx;
}
The problem when I generate a pptx file I get a shape with a placeholder and a picture as background of the shape.
Capture.PNG (12.2 KB)
So How can I set a picture to an existing shape?