BitmapMetadata.IsReadOnly 屬性

定義

取得值,這個值指出與唯讀影像相關聯的中繼資料是否唯讀。

public:
 property bool IsReadOnly { bool get(); };
public bool IsReadOnly { get; }
member this.IsReadOnly : bool
Public ReadOnly Property IsReadOnly As Boolean

屬性值

Boolean

如果中繼資料為唯讀,則為 true,否則為 false。 預設值是 false

範例

下列程式碼範例示範如何讀取物件的各種屬性 BitmapMetadata ,並將其值以字串的形式傳送至 MessageBox

FileStream stream4 = new FileStream("image3.tif", FileMode.Create);
BitmapMetadata myBitmapMetadata2 = new BitmapMetadata("tiff");
TiffBitmapEncoder encoder4 = new TiffBitmapEncoder();
MessageBox.Show(myBitmapMetadata2.IsFixedSize.ToString());
MessageBox.Show(myBitmapMetadata2.IsReadOnly.ToString());
MessageBox.Show(myBitmapMetadata2.Format.ToString());
MessageBox.Show(myBitmapMetadata2.Location.ToString());
encoder4.Frames = decoder2.Frames;
encoder4.Save(stream4);
stream4.Close();
Dim stream4 As New FileStream("image3.tif", FileMode.Create)
Dim myBitmapMetadata2 As New BitmapMetadata("tiff")
Dim encoder4 As New TiffBitmapEncoder()
MessageBox.Show(myBitmapMetadata2.IsFixedSize.ToString())
MessageBox.Show(myBitmapMetadata2.IsReadOnly.ToString())
MessageBox.Show(myBitmapMetadata2.Format.ToString())
MessageBox.Show(myBitmapMetadata2.Location.ToString())
encoder4.Frames = decoder2.Frames
encoder4.Save(stream4)
stream4.Close()

適用於