編輯

共用方式為


BitmapMetadata(String) Constructor

Definition

Initializes a new instance of BitmapMetadata for use with the specified image format.

public:
 BitmapMetadata(System::String ^ containerFormat);
[System.Security.SecurityCritical]
public BitmapMetadata (string containerFormat);
public BitmapMetadata (string containerFormat);
[<System.Security.SecurityCritical>]
new System.Windows.Media.Imaging.BitmapMetadata : string -> System.Windows.Media.Imaging.BitmapMetadata
new System.Windows.Media.Imaging.BitmapMetadata : string -> System.Windows.Media.Imaging.BitmapMetadata
Public Sub New (containerFormat As String)

Parameters

containerFormat
String

The format of the bitmap image, specified as "gif", "jpg", "png", or "tiff".

Attributes

Exceptions

containerFormat is null.

Examples

The following example demonstrates how to write metadata to a Tagged Image File Format (TIFF) image by using the IFD and Exif schemas.

BitmapMetadata tiffMetadata = new BitmapMetadata("tiff");
tiffMetadata.SetQuery("/ifd/{ushort=1000}", 9999);
tiffMetadata.SetQuery("/ifd/{uint=1001}", 23456);
tiffMetadata.SetQuery("/ifd/{uint=1002}", 34567);
tiffMetadata.SetQuery("/ifd/PaddingSchema:padding", (UInt32)4096);
tiffMetadata.SetQuery("/ifd/exif", new BitmapMetadata("exif"));
tiffMetadata.SetQuery("/ifd/exif/PaddingSchema:padding", (UInt32)4096);
Dim tiffMetadata As New BitmapMetadata("tiff")
tiffMetadata.SetQuery("/ifd/{ushort=1000}", 9999)
tiffMetadata.SetQuery("/ifd/{uint=1001}", 23456)
tiffMetadata.SetQuery("/ifd/{uint=1002}", 34567)
tiffMetadata.SetQuery("/ifd/PaddingSchema:padding", CType(4096, UInt32))
tiffMetadata.SetQuery("/ifd/exif", New BitmapMetadata("exif"))
tiffMetadata.SetQuery("/ifd/exif/PaddingSchema:padding", CType(4096, UInt32))

Applies to