Windows Phone 8 从手机库中获取拍摄的照片 [英] Windows Phone 8 Obtain Taken Photos From Phone Library
问题描述
我正在互联网上搜索如何从我的应用程序中执行此操作.似乎有很多指南,如下所示:
I am scouring the internet on how to do this from within my app. There seems to be quite a few guides like the following one:
http://msdn.microsoft.com/en-us/library/windowsphone/develop/microsoft.xna.framework.media.medialibrary.aspx
但是,他们使用 XNA 来接入 MediaLibrary.不幸的是,在 Windows Phone 8 中,这不可用(至少对我而言).
However, they use XNA to tap into the MediaLibrary. Unfortunately in Windows Phone 8, this is not available (at least to me).
有没有办法获取手机相机应用程序已经拍摄的照片并从应用程序保存到该文件夹中?
Is there a way to obtain the photos already taken by the phone camera app and also save into that folder from the app?
我很抱歉有一个有点含糊的问题.非常感谢任何帮助!
I apologize for having somewhat of a vague question. Any help is greatly appreciated!
推荐答案
所以你必须从 Camera Roll
中获取 Pictures
?试试这个
So you have to take Pictures
from Camera Roll
? Try this
Void GetCameraPhotos()
{
var imageList = new ObviousCollection<Images>();
using (var library = new MediaLibrary())
{
//taking all albums
PictureAlbumCollection allAlbums = library.RootPictureAlbum.Albums;
//taking Camera Roll album separately from all album
PictureAlbum cameraRoll = allAlbums.Where(album => album.Name == "Camera Roll").FirstOrDefault();
// here you will get camera roll picture list
var CameraRollPictures = cameraRoll.Pictures
}
}
希望对你有帮助
这篇关于Windows Phone 8 从手机库中获取拍摄的照片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!