Byte[]に格納されているデータをWritableBitmapに変換するためには、
MemoryStream を経由してBitmapImageのStreamSourceに設定するのがよいらしいです。ただし、BeginInitとEndInitが必要です。これがないとダメです。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MemoryStream mstr = new MemoryStream(data); | |
bitmapImage = new BitmapImage(); | |
bitmapImage.BeginInit(); | |
bitmapImage.StreamSource = mstr; | |
bitmapImage.EndInit(); |
0 件のコメント:
コメントを投稿