我正在尝试通过共享媒体库中的照片,SharedMediaTask
但我从GetPath()
. 错误说:
错误 1“Microsoft.Xna.Framework.Media.MediaLibrary”不包含“GetPath”的定义和最佳扩展方法重载...
这是我通过以下方式共享照片的代码SharedMediaTask
:
//Open Saved image from isolated storage
IsolatedStorageFile Store = IsolatedStorageFile.GetUserStoreForApplication();
IsolatedStorageFileStream toShare = new IsolatedStorageFileStream(filePath1, FileMode.Open, FileAccess.ReadWrite, Store);
//Save image to media library
MediaLibrary library = new MediaLibrary();
library.SavePicture("Memefy_Photo", toShare);
//Open ShareMediaTask
var task = new ShareMediaTask();
task.FilePath = library.GetPath(); //<----THIS is where the error appears :(
task.Show();
此外,根据我的研究,我还使用它using Microsoft.Xna.Framework.Media.PhoneExtensions;
来启用所需的功能。GetPath()
非常感谢任何指导。