We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Red Border around Images on Slide?

I have code that programmatically gets images and puts them into a PowerPoint 2007 file (using ImageEx, AddPictureFrame(), etc.). That works very well and as expected. However, there is one minor thing that's occurring and I can't figure out why. When we look at the resulting presentation file, all of the images that were added have a light red border around them. The original images do not so I don't know where they're coming from.

Any idea as to why this might be happening and what I can do to resolve it?


Dear Jamal,

Actually, the red line that you may be obtaining around the picture frame is due to default line format used by Aspoe.Slides. You may please need to set the line format to FillTypeEx.NoFill;, in order to obtain no line around the picture frame.

//Instantiate PrseetationEx class that represents the PPTX

PresentationEx pres = new PresentationEx();

//Get the first slide

SlideEx sld = pres.Slides[0];

//Instantiate the ImageEx class

System.Drawing.Image img = (System.Drawing.Image)new Bitmap("d:\\Aspose Data\\Desert.jpg");

ImageEx imgx = pres.Images.AddImage(img);

//Add Picture Frame with height and width equivalent of Picture

int idx=sld.Shapes.AddPictureFrame(ShapeTypeEx.Rectangle, 50, 150, imgx.Width, imgx.Height, imgx);

//Setting no line for picture frame

ShapeEx shp = sld.Shapes[idx];

shp.LineFormat.FillFormat.FillType = FillTypeEx.NoFill;

//Write the PPTX file to disk

pres.Write("d:\\Aspose Data\\RectPicFrame.pptx");

Thanks and Regards,

Thanks... I had found that about 30 minutes after my initial post by looking at the ShapeEx properties. Works great!

Thanks for responding.