これを数日間解決しようとしています-(WP7)Win 8で初めて動作しました。助けていただければ幸いです..
単純に、Isolated Storage から JPEG を読み取り、JPEG を書き込み可能なビットマップに変換してから、ピクセルをいじりたいだけです。私が現在試しているコードはこれで、主にこのサイトからコピーされたものです:-)..問題は、wbm (WritableBitmap) .pixels を見ると、それらはすべて -1 です..メモリストリームは適切な JPEG ですが、私はビットマップが欲しい..
BitmapImage bi = new BitmapImage();
using (IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication())
{
using (IsolatedStorageFileStream fileStream = myIsolatedStorage.OpenFile(s, FileMode.Open, FileAccess.Read))
{
bi.SetSource(fileStream);
fileStream.Position = 0; // just in case..
WriteableBitmap wbm = new WriteableBitmap(bi);
wbm.LoadJpeg(fileStream);
}
}
また、次を挿入しようとしました---
bi.CreateOptions = BitmapCreateOptions.None;
bi.ImageOpened += (x, e) =>
{
WriteableBitmap wbm = new WriteableBitmap((BitmapImage)x);
};
ビットマップがロードされていることを確認する..
助けてくれてありがとう