関連するメタデータを使用して WP7/XNA アプリに jpeg 画像をインポートする必要があります。これらの画像を管理するプログラムは、jpg ファイルのバイト [] をエンコードした XML ファイルにエクスポートします。
再シリアル化されたオブジェクトを XNA プロジェクトに正常にインポートするカスタム インポーター/プロセッサを作成しました。
私の質問は、jpg の byte[] を考えると、それを Texture2D に変換する最良の方法は何かということです。
// 'Standard' method for importing image
Texture2D texture1 = Content.Load<Texture2D>("artwork"); // Uses the standard Content processor "Texture - XNA Framework" to import an image.
// 'Custom' method
var myCustomObject = Content.Load<CompiledBNBImage>("gamedata"); // Uses my custom content Processor to return POCO "CompiledBNBImage"
byte[] myJPEGByteArray = myCustomObject.Image; // byte[] of jpeg
Texture2D texture2 = ???? // What is the best way to convert myJPEGByteArray to a Texture2D?
どうもありがとうございました。:-)
DS