I’m adding a picture frame to the masterslide in powerpoint and setting the link (picture url) to and external site. Works in PPTX format, but can’t figure out how to do this in PPT format.
In PowerPoint, the steps are View/SlideMaster, Insert Picture, paste URL in File Name text box, and under Insert choose “Insert and Link”.
Code for pptx below, and trying to do the same for ppt.
Aspose.Slides.Pptx.MasterSlideEx slide = presentation.Masters[0];
string picLoc = @"http://mysite.com/myimage.gif
";
int pfID = slide.Shapes.AddPictureFrame(Aspose.Slides.Pptx.ShapeTypeEx.Rectangle,1,1,1,1,null);
Aspose.Slides.Pptx.PictureFrameEx pfx =
slide.Shapes[pfID] as Aspose.Slides.Pptx.PictureFrameEx;
pfx.PictureFormat.Picture.Url
= picLoc;
PPT code below. I am getting a new 40x40 pictureframe, but not linked to external picture.
Slide slide = presentation.MainMaster;
string picLoc = @“http://mysite.com/myimage.gif
”;
Picture pic = new Picture(presentation, new Bitmap(40, 40));
int picID = presentation.Pictures.Add(pic);
PictureFrame pf = slide.Shapes.AddPictureFrame(picID,1,1,40,40);
pf.PictureFileName = picLoc;