我们如何使用 MediaLibrary 类的 Pictures/RootPictureAlbum/SavedPicture API 来访问 SavedPicture 文件夹中的照片以将它们读入字节缓冲区?
问问题
217 次
1 回答
1
用这种方法试试
using (var library = new MediaLibrary())
{
var savedPictures = library.Pictures.ToList();
if (savedPictures.Any())
{
foreach (var pic in savedPictures)
{
var bitmap = new WriteableBitmap(pic.Width, pic.Height);
using (var stream = pic.GetImage()) //here you will get the stream
{
bitmap.SetSource(stream);
}
}
}
}
于 2014-01-02T05:06:46.477 回答