获取windows phone中存储图像的路径 [英] getting the path of the stored image in windows phone

查看:31
本文介绍了获取windows phone中存储图像的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将图像存储到相机胶卷中

I am storing the image into camera roll

library.SavePictureToCameraRoll(DateTime.Now.ToString() + ".jpg", e.ImageStream);

我的问题是如何在存储此图像后获取此图像的路径.

my Problem is How can i get the path of this image after storing this image.

推荐答案

在 WP8 上,SavePictureToCameraRoll 返回一个 Picture 对象,您可以在该对象上调用 GetPath 方法(不要忘记添加 using Microsoft.Xna.Framework.Media.PhoneExtensions;)

On WP8, SavePictureToCameraRoll returns a Picture object on which you can call the GetPath method (don't forget to add the using Microsoft.Xna.Framework.Media.PhoneExtensions;)

var picture = lib.SavePicture(string.Format("test.jpg"), ms);
var filePath = picture.GetPath();

不幸的是,在 WP7 上无法获取路径,因为 SavePictureToCameraRoll 不返回任何内容.

Unfortunately, on WP7 there is no way to get the path, because SavePictureToCameraRoll doesn't return anything.

这篇关于获取windows phone中存储图像的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆