TiffCompressOption 枚举

定义

指定关于标记图像文件格式 (TIFF) 位图的可行压缩方案。

C#
public enum TiffCompressOption
继承
TiffCompressOption

字段

Ccitt3 2

使用 CCITT3 压缩方案。

Ccitt4 3

使用 CCITT4 压缩方案。

Default 0

TiffBitmapEncoder 编码器尝试使用最佳的可行压缩方案保存位图。

Lzw 4

使用 LZW 压缩方案。

None 1

不会压缩标记图像文件格式 (TIFF) 图像。

Rle 5

使用 RLE 压缩方案。

Zip 6

使用 Zip 压缩方案。

示例

下面的示例演示如何使用该 Compression 属性。

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);

注解

Ccitt3、Ccitt4 和 Rle 要求将 PixelFormat 值设置为 BlackWhitePixelFormat将设置为任何其他值会将Compression属性值重置为默认值。

适用于

产品 版本
.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
Windows Desktop 3.0, 3.1, 5, 6, 7

另请参阅