为什么调用保存图片到手机的SavePicture方法会抛出异常
MediaLibrary library = new MediaLibrary();
string lName = "picture1.jpg";
var myStore = IsolatedStorageFile.GetUserStoreForApplication();
if (myStore.FileExists(lName))
{
MessageBox.Show("图片已经存在");
}
else
{
IsolatedStorageFileStream myFileStream = myStore.CreateFile(lName);
WriteableBitmap _bitmap = new WriteableBitmap(inkPresenter, null);
Extensions.SaveJpeg(_bitmap, myFileStream, _bitmap.PixelWidth, _bitmap.PixelHeight, 0, 85);
myFileStream.Close();
myFileStream = myStore.OpenFile(lName, FileMode.Open, FileAccess.Read);
try
{
Picture pic = library.SavePicture(lName, myFileStream);
MessageBox.Show("保存成功!", "提示", MessageBoxButton.OK);
}
catch (Exception)
{
MessageBox.Show("异常");
}
myFileStream.Close();
异常 WindowsPhone exception SavePicture
[解决办法]
你在manifest文件中声明了吗
[解决办法]