Get an error tring to using EncoderValue.CompressionCCITT3
The error message is "Invalid parameter used.", but when I change it to .CompressionLZW it works. All the examples that I found were written in VB.NET and they look like my function below.
private bool SaveTIFF(ref string outputFile, ref Bitmap bmp, bool bAdd)
{
try
{
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.CompressionCCITT3);
ImageCodecInfo info=GetEncoderInfo("image/tiff");
if (!bAdd)
{
bmp.Save(outputFile,info,ep);
}
else
{
bmp.SaveAdd(ep);
}
bmp.Dispose();
return true;
}