TiffCompressOption Enum

Definition

Specifies the possible compression schemes for Tagged Image File Format (TIFF) bitmap images.

C#
public enum TiffCompressOption
Inheritance
TiffCompressOption

Fields

Name Value Description
Default 0

The TiffBitmapEncoder encoder attempts to save the bitmap with the best possible compression schema.

None 1

The Tagged Image File Format (TIFF) image is not compressed.

Ccitt3 2

The CCITT3 compression schema is used.

Ccitt4 3

The CCITT4 compression schema is used.

Lzw 4

The LZW compression schema is used.

Rle 5

The RLE compression schema is used.

Zip 6

Zip compression schema is used.

Examples

The following example demonstrates how to use the Compression property.

C#
var stream = new FileStream("new.tif", FileMode.Create);
var encoder = new TiffBitmapEncoder();
var myTextBlock = new TextBlock();
myTextBlock.Text = "Codec Author is: " + encoder.CodecInfo.Author.ToString();
encoder.Compression = TiffCompressOption.Zip;
encoder.Frames.Add(BitmapFrame.Create(image));
encoder.Save(stream);

Remarks

The Ccitt3, Ccitt4, and Rle require that the PixelFormat value be set to BlackWhite. Setting the PixelFormat to any other value resets the Compression property value to Default.

Applies to

Product Versions
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also