我无法将图像保存到 Windows Phone 媒体库中!这是我的代码片段:
public void SaveImageTo(string fileName)
{
fileName += ".jpg";
var myStore = IsolatedStorageFile.GetUserStoreForApplication();
if (myStore.FileExists(fileName))
{
myStore.DeleteFile(fileName);
}
IsolatedStorageFileStream myFileStream = myStore.CreateFile(fileName);
// 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();
library.SavePicture(fileName, myFileStream);
}
请给点建议!提前致谢 !