在我的应用程序中我有一个图片列表。我想确定单个图像的大小但没有属性。
using (MediaLibrary library = new MediaLibrary())
{
CameraRollAlbum = library.RootPictureAlbum.Albums.First((album) => album.Name == "Camera Roll");
List<Picture> pictures = CameraRollAlbum.Pictures.Tolist();
foreach (Picture pic in pictures)
{
pic.size?? pic.length??
}
}
答案 0 :(得分:0)
获取图像流eval的大小:
foreach (Picture pic in pictures)
{
var sizeInKb = pic.GetImage().Length / 1024;
}
http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.media.picture_members.aspx