TiffBitmapEncoder.Compression Property


Gets or sets a value that indicates the type of compression that is used by this Tagged Image File Format (TIFF) image.

Namespace:   System.Windows.Media.Imaging
Assembly:  PresentationCore (in PresentationCore.dll)

public TiffCompressOption Compression { get; set; }

The Ccitt3, Ccitt4, and Rle values require that the PixelFormat value be set to PixelFormats.BlackWhite.

The following example demonstrates how to use the Compression property.

FileStream stream = new FileStream("new.tif", FileMode.Create);
TiffBitmapEncoder encoder = new TiffBitmapEncoder();
TextBlock myTextBlock = new TextBlock();
myTextBlock.Text = "Codec Author is: " + encoder.CodecInfo.Author.ToString();
encoder.Compression = TiffCompressOption.Zip;

.NET Framework
Available since 3.0
Return to top