Some of the code is below, when I change the EncoderValue.CompressionCCITT3
to EncoderValue.CompressionLZW it works fine. The error message is the
generic error "Invalid parameter used.", I suspect one of the
EncoderParameters is either wrong of missing. Thanks.
Bitmap bmp = new Bitmap(814, 1148);
Graphics g = Graphics.FromImage(bmp);
g.FillRectangle(Brushes.White, 0, 0, 814, 1148);
System.Drawing.Imaging.Encoder eng =
System.Drawing.Imaging.Encoder.SaveFlag;
System.Drawing.Imaging.Encoder eng1 =
System.Drawing.Imaging.Encoder.Compression;
EncoderParameters ep = new EncoderParameters(2);
ep.Param[0] = new
EncoderParameter(eng,(long)EncoderValue.MultiFrame );
ep.Param[1] = new
EncoderParameter(eng1,(long)EncoderValue.Compressi onCCITT3);
ImageCodecInfo info =
GetEncoderInfo("image/tiff");
bmp.Save(outputFile,info,ep);