我不知道为什么我会遇到这个错误!这是我的代码片段:
public void SaveImageTo(string fileName="ABC.jpg")
{
var myStore = IsolatedStorageFile.GetUserStoreForApplication();
if (myStore.FileExists(fileName))
{
myStore.DeleteFile(fileName);
}
IsolatedStorageFileStream myFileStream = myStore.CreateFile(fileName);
qrImage.SaveJpeg(myFileStream, qrImage.PixelWidth, qrImage.PixelHeight, 0, 85);
myFileStream.Close();
// Create a new stream from isolated storage, and save the JPEG file to the media library on Windows Phone.
myFileStream = myStore.OpenFile(fileName, FileMode.Open, FileAccess.Read);
MediaLibrary library = new MediaLibrary();
//byte[] buffer = ToByteArray(qrImage);
library.SavePicture(fileName, myFileStream);
}
它给了我“IsolatedStorageFileStream 上不允许的操作”,这里 qrImage 是一个全局可写位图。需要帮忙 !提前致谢 !