ごめんなさい、私が直接解析または生成された画像オブジェクトから「適切な」ImageFormatを抽出するいかなる可能性が見つかりませんでした。
これは私のコードですが、mimetypeの代わりに静的なImageFormatメンバーを格納することでそれを採用することができます。
if (image.RawFormat.Equals(ImageFormat.Jpeg))
binary.MetaInfo.Mimetype = "image/jpeg";
else if (image.RawFormat.Equals(ImageFormat.Bmp))
binary.MetaInfo.Mimetype = "image/bmp";
else if (image.RawFormat.Equals(ImageFormat.Emf))
binary.MetaInfo.Mimetype = "image/emf";
else if (image.RawFormat.Equals(ImageFormat.Exif))
binary.MetaInfo.Mimetype = "image/exif";
else if (image.RawFormat.Equals(ImageFormat.Gif))
binary.MetaInfo.Mimetype = "image/gif";
else if (image.RawFormat.Equals(ImageFormat.Icon))
binary.MetaInfo.Mimetype = "image/icon";
else if (image.RawFormat.Equals(ImageFormat.Png))
binary.MetaInfo.Mimetype = "image/png";
else if (image.RawFormat.Equals(ImageFormat.Tiff))
binary.MetaInfo.Mimetype = "image/tiff";
else if (image.RawFormat.Equals(ImageFormat.Wmf))
binary.MetaInfo.Mimetype = "image/wmf";
あなたは、静的なImageFormatのメンバーの配列を使用することによって、それを片付けることができ、私はあなたがスイッチまたはループを避けることはできないと思います。私は同じためヘプラー方法に従って使用し
敬具、マティアス
.jpgのために何をすべきですか? – Elnaz