Hi Mudassir,
I muddled around and found some code for loading the ImageEx in 217228. I modified that into a routine to load a file, create an ImageEx, and store it in the Presentation:
Public Shared Function loadImageExFromFile(ByVal oPres As PresentationEx, ByVal sFile As String) As ImageEx
Dim oBA() As Byte
Dim oFS As FileStream
Dim oBR As BinaryReader
Dim oMS As MemoryStream
Dim oImg As System.Drawing.Image
Dim oImageEx As ImageEx
Dim iLen As Int32
oFS = New FileStream(sFile, FileMode.Open, FileAccess.Read)
oBR = New BinaryReader(oFS)
iLen = New FileInfo(sFile).Length
oBA = oBR.ReadBytes(iLen)
oMS = New MemoryStream(oBA)
oImg = System.Drawing.Bitmap.FromStream(oMS)
oImageEx = oPres.Images.AddImage(oImg)
Return oImageEx
End Function
From there, I had created a new PictureFrameEx with the ImageEx and deleted the old one. Your line in the referenced link showed me how to changed the image directly in the PictureFrameEx:
oArt = PPTx.loadImageExFromFile(oPres, sFile)
oPic = CType(oSlide.FindShapeByAltText("Art"), PictureFrameEx)
oPic.PictureFormat.Picture.Image = oArt // Your new line replacing the image directly.
Thanks for your help, and I hope this thread will help others solve this problem.
Brad