BitmapPropertiesView.GetPropertiesAsync(IIterable<String>) メソッド

定義

1 つ以上のビットマップ プロパティを非同期的に取得します。

public:
 virtual IAsyncOperation<BitmapPropertySet ^> ^ GetPropertiesAsync(IIterable<Platform::String ^> ^ propertiesToRetrieve) = GetPropertiesAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<BitmapPropertySet> GetPropertiesAsync(IIterable<winrt::hstring> const& propertiesToRetrieve);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<BitmapPropertySet> GetPropertiesAsync(IEnumerable<string> propertiesToRetrieve);
function getPropertiesAsync(propertiesToRetrieve)
Public Function GetPropertiesAsync (propertiesToRetrieve As IEnumerable(Of String)) As IAsyncOperation(Of BitmapPropertySet)

パラメーター

propertiesToRetrieve

IIterable<String>

IEnumerable<String>

IIterable<Platform::String>

IIterable<winrt::hstring>

要求されているプロパティ キーまたはクエリを表す文字列のコレクション。 有効な文字列には、 Windows プロパティWindows Imaging Component メタデータ クエリが含まれます。

戻り値

ビットマップ プロパティの非同期取得を管理する オブジェクト。

実装

M:Windows.Graphics.Imaging.IBitmapPropertiesView.GetPropertiesAsync(System.Collections.Generic.IEnumerable{System.String}) M:Windows.Graphics.Imaging.IBitmapPropertiesView.GetPropertiesAsync(System.Collections.Generic.IEnumerable{Platform::String}) M:Windows.Graphics.Imaging.IBitmapPropertiesView.GetPropertiesAsync(System.Collections.Generic.IEnumerable{winrt::hstring})
属性

注釈

非同期操作では、要求されたイメージ プロパティ キーとその値を表すコレクションが生成されます。 値は BitmapTypedValue として格納されます。この値には、実際のデータとデータの PropertyType の両方が含まれます。

特定のイメージには、要求されたプロパティの一部 (または含まれていない) のみが含まれる場合があります。 この場合、コレクションには、イメージで見つかったプロパティのキーと値のペアのみが含まれます。 プロパティからデータを取得する前に、プロパティの存在をチェックする必要があります。

bitmapPropertiesView.getPropertiesAsync(["System.Title"]).done(function (retrievedProperties) {
  if (retrievedProperties.hasKey("System.Title")) {
	  	var titleProperty = retrievedProperties.lookup("System.Title");
	  	var title = titleProperty.value;
	 }
});

メタデータ ブロックのクエリ

メタデータ クエリ言語を使用してプロパティではなくメタデータ ブロックを要求する場合、返される値は、そのブロック内のメタデータを表す BitmapPropertiesView です。 ブロック内に含まれるメタデータは、 BitmapPropertiesView から要求できます。

// this is equivalent to directly requesting "/app1/ifd/{ushort=274}" from bitmapPropertiesView
bitmapPropertiesView.getPropertiesAsync(["/app1/ifd"]).done(function (retrievedProperties) {
	  // var ifdBlock is a BitmapPropertiesView
	  var ifdBlock = retrievedProperties.lookup("/app1/ifd").value;
	  return ifdBlock.getPropertiesAsync(["/{ushort=274}");
}).then(function (retrievedProperties) {
	  var orientation = retrievedProperties.lookup("/{ushort=274}").value;
});

フレーム内のすべてのメタデータを列挙する

文字列の空の (長さ 0 の) コレクションを渡すことで、サブブロックやプロパティを含むメタデータ ブロックのすべての内容を要求できます。 これにより、 BitmapPropertiesView のスコープ内のすべてのサブブロックとプロパティを含むコレクションが生成されます。 このようにして、イメージ フレーム内に含まれるすべてのメタデータを反復的に取得できます。

bitmapPropertiesView.getPropertiesAsync([]).done(function (retrievedProperties) {
	  var iterator = retrievedProps.first();
	  while (iterator.hasCurrent) {
		  // iterator.current gives a key-value pair of string, BitmapTypedValue
		  // nextMetadataBlock is a BitmapPropertiesView containing the sub-block
		  var nextMetadataBlock = iterator.current.value.value;
		  iterator.moveNext();
	}
});

イメージ形式でメタデータがサポートされていない場合は、HRESULT WINCODEC_ERR_UNSUPPORTEDOPERATIONで失敗します。

適用対象

こちらもご覧ください