0

I've used the code in the question

What would be a good TRUE black and white colormatrix?

and works fine.. but when I try to save in TIFF with CCITT4 compression, an error occour, invalid parameter value... If I use the LZW compression, it works fine.. I use the code:

Dim myImageCodecInfo As ImageCodecInfo
myImageCodecInfo = GetEncoderInfo(ImageFormat.Tiff)

Dim myEncoderParameters As New EncoderParameters(1)
Dim myEncoderParameter As New EncoderParameter(System.Drawing.Imaging.Encoder.Compression, EncoderValue.CompressionCCITT4)
myEncoderParameters.Param(0) = myEncoderParameter

bmp.Save(path & "\test.tif", myImageCodecInfo, myEncoderParameters)

Someone can help me? Thanks..

Community
  • 1
  • 1
Boy80
  • 11
  • 6
  • So, you have a specific question + specific answer + code and you are not even able to understand what this code is doing and perform the required (minor) modifications?! Do you think that this is the behaviour of a programming with basic knowledge? And what is more important: have you read the help pages explaining how to use SO?! Completely off-topic. – varocarbas Dec 02 '15 at 08:49

1 Answers1

0

Problem solved with the project:

http://www.codeproject.com/Articles/15186/Bitonal-TIFF-Image-Converter-for-NET

bmp must be converted in bitonal 1bpp indexed otherwise the bmp.save function in CCITT4 compression format cause error.

Boy80
  • 11
  • 6