Dear Aspose Staff,
I found the following codes in the thread “How to add image from URL to slide” in your forum, which explained how to add image from URL to slide. This thread was in 2009.
I’ve tried to use the same code with v14.10 . However, it reports that “Serialize” is not a function/member of Shape object. Is “Serialize” not in Shape object anymore in v14.10?
If so, how can I add image from URL to Slide in v14.10?
I am looking forward to your advice. Thank you very much.
The following codes are from 2009 thread “How to add image from URL to slide”
VB.NET
'Source presentation to get the linked picture from
Dim srcPres As Presentation = New Presentation("c:\test\source.ppt")
'Source slide with a single shape which is a linked pictureframe
Dim srcSld As Slide = srcPres.GetSlideByPosition(1)
'Serialize the pictureframe
Dim shp As Shape = srcSld.Shapes(0)
Dim ms As MemoryStream = New MemoryStream()
shp.Serialize(ms)
'Now once serialized, we can import into our target presentation
'Create a target presentation
Dim target As Presentation = New Presentation()
Dim targetSld As Slide = target.GetSlideByPosition(1)
'Import the serialized shape
ms.Position = 0
targetSld.Shapes.Add(ms)
'Access the shape as a pictureframe
Dim pf As PictureFrame = CType(targetSld.Shapes(0), PictureFrame)
'Change its link path
pf.PictureFileName = "http:\\www.aspose.com/Images/aspose-logo.jpg"
'Write the target presentation on disk.
target.Write("c:\test\output.ppt")