TiffBitmapEncoder.Compression 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定值,這個值表示這個標記影像檔案格式所使用的壓縮類型, (TIFF) 影像。
public:
property System::Windows::Media::Imaging::TiffCompressOption Compression { System::Windows::Media::Imaging::TiffCompressOption get(); void set(System::Windows::Media::Imaging::TiffCompressOption value); };
public System.Windows.Media.Imaging.TiffCompressOption Compression { get; set; }
member this.Compression : System.Windows.Media.Imaging.TiffCompressOption with get, set
Public Property Compression As TiffCompressOption
屬性值
其中一個 TiffCompressOption 值。 預設值為 Default。
範例
下列範例示範如何使用 Compression 屬性。
FileStream^ stream = gcnew FileStream("new.tif", FileMode::Create);
TiffBitmapEncoder^ encoder = gcnew TiffBitmapEncoder();
TextBlock^ myTextBlock = gcnew TextBlock();
myTextBlock->Text = "Codec Author is: " + encoder->CodecInfo->Author->ToString();
encoder->Compression = TiffCompressOption::Zip;
encoder->Frames->Add(BitmapFrame::Create(image));
encoder->Save(stream);
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);
Dim stream As New FileStream("new.tif", FileMode.Create)
Dim encoder As New TiffBitmapEncoder()
Dim myTextBlock As 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 值設定為 PixelFormats.BlackWhite 。