Link to home
Start Free TrialLog in
Avatar of zimmer9
zimmer9Flag for United States of America

asked on

How to append mutipage TIFF Images to a file that is saved using C#? - Image.SaveAdd Method

I am writing a C# console application using VS2010 to generate multipage TIFF images and save these images to a file.

 The variable "img" contains the front image of a check.

 The variable "img2" contains the back image of a check.

 Function A is performed for each pair of front and back images of each check processed from an input file:

 Funtion A

    Byte[] img =  bytes.Skip(irecpositionrevised + irectypelength).Take(intpos1revised).ToArray();

    Byte[] img1 = bytes.Skip(irecpositionrevised + irectypelength + intpos1revised).Take(intpos2revised).ToArray();

    newImage[CheckOrderNum - 1] = MergeTwoImages(ConvertFromByteArray(img), ConvertFromByteArray(img1));

 After all checks have been read & processed via Function A, the following foreach loop is performed to write out
 ALL multipage TIFF images:

 foreach (Image image in newImage)
     image.Save("L:\\F\\Source\\test1.tiff", System.Drawing.Imaging.ImageFormat.Tiff);   <-- this Save only Saves the current TIFF Image            

My goal is to write out ALL mulitpage TIFF Images to a file titled test1.tiff, so that I can see the front image & back image of ALL checks my application reads from an input file.

Currenlty my program OVERWRITES the existing TIFF multipage Image with the most recent TIFF mulitpage read in.

Could you convert the VB6 code in the following link to work with my statements above so that I can append the current record to the existing records? - Image.SaveAdd Method
Avatar of it_saige
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial