LateBoundBitmapDecoder.CodecInfo 属性

定义

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

public:
 virtual property System::Windows::Media::Imaging::BitmapCodecInfo ^ CodecInfo { System::Windows::Media::Imaging::BitmapCodecInfo ^ get(); };
public override System.Windows.Media.Imaging.BitmapCodecInfo CodecInfo { [System.Security.SecurityCritical] get; }
public override 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 Overrides ReadOnly Property CodecInfo As BitmapCodecInfo

属性值

BitmapCodecInfo 的一个实例。 此属性没有默认值。 如果仍在下载后期绑定解码器,则此属性返回 null

属性

示例

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

FileStream^ stream = gcnew FileStream("new.bmp", FileMode::Create);
BmpBitmapEncoder^ encoder = gcnew BmpBitmapEncoder();
TextBlock^ myTextBlock = gcnew TextBlock();
myTextBlock->Text = "Codec Author is: " + encoder->CodecInfo->Author->ToString();
encoder->Frames->Add(BitmapFrame::Create(image));
encoder->Save(stream);
FileStream stream = new FileStream("new.bmp", FileMode.Create);
BmpBitmapEncoder encoder = new BmpBitmapEncoder();
TextBlock myTextBlock = new TextBlock();
myTextBlock.Text = "Codec Author is: " + encoder.CodecInfo.Author.ToString();
encoder.Frames.Add(BitmapFrame.Create(image));
encoder.Save(stream);
Dim stream As New FileStream("new.bmp", FileMode.Create)
Dim encoder As New BmpBitmapEncoder()
Dim myTextBlock As New TextBlock()
myTextBlock.Text = "Codec Author is: " + encoder.CodecInfo.Author.ToString()
encoder.Frames.Add(BitmapFrame.Create(image))
encoder.Save(stream)

适用于

另请参阅