Skip to content

Instantly share code, notes, and snippets.

@biac
Created Jan 25, 2013
Embed
What would you like to do?
WP8 で PictureAlbum の中の画像を取り出してみるテスト
using Microsoft.Xna.Framework.Media;
using System;
namespace PhoneApp1
{
public class PhotoAlbums
{
public static Picture GetFirstPhoto() {
MediaLibrary mediaLib = new MediaLibrary();
foreach (var album in mediaLib.RootPictureAlbum.Albums)
{
if (album.Pictures == null || album.Pictures.Count == 0)
continue;
return album.Pictures[0];
}
return null;
}
}
}
@biac

This comment has been minimized.

Copy link
Owner Author

@biac biac commented Jan 25, 2013

WP8エミュは、起動後に一回「フォト」アプリを開いてからじゃないと、上のコードでは画像が取れない。
なじぇ~?

@biac

This comment has been minimized.

Copy link
Owner Author

@biac biac commented Jan 25, 2013

ID_CAP_MEDIALIB_PHOTO を忘れる人も居るらしいw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment