Question : Tiff File Compression

The below shown code I used to set the "CompressionCCITT4" for Tiff Image, while generating the code, I am getting the error message called "Invalid Parameter".

Rectify the error provide the alternate solution for the same.

ImageCodecInfo ici = getCodecForstring("TIFF");
Encoder myEncoder = Encoder.Compression;
EncoderParameters myEncoderParameters = new EncoderParameters(1);
EncoderParameter myEncoderParameter = new EncoderParameter(myEncoder, (long)EncoderValue.CompressionCCITT4);
myEncoderParameters.Param[0] = myEncoderParameter;

_img.Save(sSavePath, ici, myEncoderParameters);

Answer : Tiff File Compression

Thanks, for your work on the same. I also tried the same activity, it will change the color of the layer not the color property.

Finally I got the solution, By setting the image quality with JPEG pixel format for the tiff image, the size get reduced.

Issue
ImageCodecInfo ici = getCodecForstring("TIFF");

Solution.
ImageCodecInfo ici = getCodecForstring("JPEG");

by changing the parameter, my issue got solved.




Random Solutions  
 
programming4us programming4us