Getting an error while useing EncoderValue.CompressionCCITT3
The error message is "Invalid parameter used." but when I change the value to CompressionLZW it works. Am I missing something?
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;
}
catch(Exception e)
{
ErrorLg er = new ErrorLg();
er.LogErrorToDisk(e.Message.ToString(),"ParseFundValue" + ":Main()",_path);
e = null;
er = null;
return false;
}