I am using Slides to automatically generate PPTx (just trial version at the moment).
For a large number of slides (150) I am getting an "Out of Memory" exception. I have debugged this down to the fact that the images that are being included are being read into a System.Drawing.Bitmap which is creating a bitmap out of the jpg. I think PPTx can contain the image as a jpg (without ballooning to a bitmap). Can one load the image as a jpg into the Picture?
Currently used code to create an ImageEx:
oFS = New FileStream(sFilePath, FileMode.Open, FileAccess.Read)
oBR = New BinaryReader(oFS)
iLen = New FileInfo(sFilePath).Length
oBA = oBR.ReadBytes(iLen)
oMS = New MemoryStream(oBA)
oImg = System.Drawing.Bitmap.FromStream(oMS)
oImageEx = oPres.Images.AddImage(oImg)
oPic.PictureFormat.Picture.Image = oImageEx