WPF を使用すると、WIC コーデックを表示する必要がある画像を使用できることは承知しています (議論のために、デジタル カメラの RAW ファイルとします)。ただし、画像をネイティブに表示できることしかわかりませんが、メタデータ(露出時間など)を取得する方法はわかりません。
Windowsエクスプローラーが示すように、明らかに実行できますが、これは.net APIを介して公開されていますか、それともネイティブCOMインターフェイスを呼び出すだけだと思いますか?
私のIntuipicプロジェクトをチェックしてください。特に、メタデータを読み取って画像の向きを決定するBitmapOrientationConverterクラス:
private const string _orientationQuery = "System.Photo.Orientation";
...
using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read))
{
BitmapFrame bitmapFrame = BitmapFrame.Create(fileStream, BitmapCreateOptions.DelayCreation, BitmapCacheOption.None);
BitmapMetadata bitmapMetadata = bitmapFrame.Metadata as BitmapMetadata;
if ((bitmapMetadata != null) && (bitmapMetadata.ContainsQuery(_orientationQuery)))
{
object o = bitmapMetadata.GetQuery(_orientationQuery);
if (o != null)
{
//refer to http://www.impulseadventure.com/photo/exif-orientation.html for details on orientation values
switch ((ushort) o)
{
case 6:
return 90D;
case 3:
return 180D;
case 8:
return 270D;
}
}
}
}