BitmapEncoder.CodecInfo 属性

定义

获取此编解码器的相关描述信息。

public:
 virtual property System::Windows::Media::Imaging::BitmapCodecInfo ^ CodecInfo { System::Windows::Media::Imaging::BitmapCodecInfo ^ get(); };
public virtual System.Windows.Media.Imaging.BitmapCodecInfo CodecInfo { [System.Security.SecurityCritical] get; }
public virtual System.Windows.Media.Imaging.BitmapCodecInfo CodecInfo { get; }
[<get: System.Security.SecurityCritical>]
member this.CodecInfo : System.Windows.Media.Imaging.BitmapCodecInfo
member this.CodecInfo : System.Windows.Media.Imaging.BitmapCodecInfo
Public Overridable ReadOnly Property CodecInfo As BitmapCodecInfo

属性值

BitmapCodecInfo 的一个实例。

属性

示例

以下示例演示如何从 BitmapCodecInfo 对象读取信息并将其发送到字符串。

FileStream stream = new FileStream("empty.tif", FileMode.Create);
TiffBitmapEncoder encoder = new TiffBitmapEncoder();
TextBlock myTextBlock = new TextBlock();
myTextBlock.Text = "Codec Author is: " + encoder.CodecInfo.Author.ToString();
encoder.Frames.Add(BitmapFrame.Create(image));
MessageBox.Show(myPalette.Colors.Count.ToString());
encoder.Save(stream);
Dim stream As New FileStream("empty.tif", FileMode.Create)
Dim encoder As New TiffBitmapEncoder()
Dim myTextBlock As New TextBlock()
myTextBlock.Text = "Codec Author is: " + encoder.CodecInfo.Author.ToString()
encoder.Frames.Add(BitmapFrame.Create(image))
MessageBox.Show(myPalette.Colors.Count.ToString())
encoder.Save(stream)

注解

BitmapCodecInfo每个编解码器都需要实现。

适用于

另请参阅