Below you will see the code that I am trying to use that basically appends two images into one using the memorystream.write method.
If I debug and watch the length of the memory stream before assigning to e.imagestream, everything looks fine. The problem comes in where after the merge, only the last image shows. It appears to be the last image written to the memory stream.
So, I’m basically stuck. Am I completely going about this the wrong way?
Thanks,
wowaddict
private void HandleMergeSignature(object sender, Aspose.Words.Reporting.MergeImageFieldEventArgs e)
{
MemoryStream memorybits = new MemoryStream();
foreach (ImageEntity peiie in myImages)
{
byte[] bits = (byte[])(peiie.ExamImageBinary);
memorybits.Write(bits, 0, bits.Length);
}
memorybits.Seek(0, SeekOrigin.Begin);
e.ImageStream = memorybits; //length is correct but only 1 image displays (last written to memorystream)
}