Monday, September 14, 2009

How to Save a Bitmap as a 1BPP (bitonal) TIFF File in .NET

If you try to use the EncoderValue.CompressionCCITT4 value to save a Bitmap out as a 1 BPP Tiff file, you will get an error "Invalid Parameter Value". It turns out that .NET can't go from an RGB to a Bitonal image with the Save method on a Bitmap (no matter how you set the encoder parameters). The following posting by Michael McCloskey solves the problem:

http://www.codeproject.com/KB/GDI-plus/BitonalImageConverter.aspx?msg=2020403


Easy to use and runs quickly.

No comments: