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

Free Support Forum - aspose.com

Cannot get rid of added picture border

Always get a border that I do not want around the added picture. The LineFormat is always Nothing so what am I doing wrong here?

Dim img As System.Drawing.Image = chart.GetImage(System.Drawing.Imaging.ImageFormat.Jpeg, New Size(1000 * (width / 800), 800 * (height / 500)))
If Not img Is Nothing Then
Dim imgx As ImageEx = PPTReport.Images.AddImage(img)
Dim idx As Integer = sld.Shapes.AddPictureFrame(ShapeTypeEx.Rectangle, xPos, yPos, width, height, imgx)
sld.Shapes.Reorder(0, sld.Shapes(idx))
If Not sld.Shapes(idx).LineFormat Is Nothing Then sld.Shapes(idx).LineFormat.FillFormat.FillType = FillTypeEx.NoFill
If Not sld.Shapes(idx).LineFormat Is Nothing Then sld.Shapes(idx).LineFormat.Style = LineStyleEx.NotDefined
End If


I have observed the sample code on my end and have tried using Aspose.Slides for .NET 14.2.0 on my end. I have not been able to observe the issue on my end by using the following sample code with specified version of Aspose.Slides. Please share, if I may help you further in this regard.

'Instantiate Prseetation class that represents the PPTX
Using pres As New Presentation()

'Get the first slide
Dim sld As ISlide = pres.Slides(0)

'Instantiate the ImageEx class
Dim img As System.Drawing.Image = CType(New Bitmap(“asp.jpg”), System.Drawing.Image)
Dim imgx As IPPImage = pres.Images.AddImage(img)

'Add Picture Frame with height and width equivalent of Picture
Dim picFrame AsIPictureFrame= sld.Shapes.AddPictureFrame(ShapeType.Rectangle, 50, 150, imgx.Width, imgx.Height, imgx)

picFrame.LineFormat.FillFormat.FillType = FillType.NoFill

'Write the PPTX file to disk
pres.Save(“RectPicFrame.pptx”, SaveFormat.Pptx)
End Using

Many Thanks,


I see a difference between your code and mine: You are using a picture frame while I’m adding the pictuer to a shape.

Could not get your code to work. Is iPictureFrame implemented in a newer version or is this a spelling mistake? sld.Shapes.AddPictureFrame returns an integer which wont work if I use PictureFrame. A little bit confused here

r. BA

Hi BA,

I have observed the comments shared by you and like to add here that the sample code shared is based on new API, Aspose.Slides for .NET 14.2.0. The old series Aspose.Slides for .NET 8.x.x has been phased out. The new API is merged API for both PPT and PPTX presentation formats unlike the legacy Aspose.Slides for .NET 8.x.x series where we have separate namespaces for PPT and PPTX presentation formats. The sample code that I have shared with you is based upon the code shared over this documentation link.

You are right that in old API when you add a picture frame it returns the index of shape. However, in new API, it returns the shape object it self. Please try using the above sample code with Aspose.Slides for .NET 14.2.0 and share with us if there is any incurring issue.

Many Thanks,