I cannot get either a slide nor the main master to accept a background image. This is what I am doing:
Presentation report = new Presentation(reportReaderStream);
FillFormat fill=report.MainMaster.Background.FillFormat;
MemoryStream stream = null;
int pictureId;
try {
stream = new MemoryStream();
image.Save(stream, ImageFormat.Bmp);
Picture pict = new Picture(report, stream);
pictureId = report.Pictures.Add(pict);
}
finally {
if (stream != null)
stream.Close();}
fill.PictureId = pictureId;
fill.Type = FillType.Picture;
But the picture is always blank, and according to the debugger fill.PictureId retains its zero value instead of being updated to the value of pictureId.
I've tried setting slide.background.pictureid but that doesn't help either. I've tried this for the main master, and on individual slides with FollowMasterBackground set to false but it does not work.