保存的BitmapImage对象作为本地存储在Windows 8的文件? [英] Saving a BitmapImage object as a file in local storage in windows 8?

查看:439
本文介绍了保存的BitmapImage对象作为本地存储在Windows 8的文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个BitmapImage的对象,它已经拥有了源等集。我只是想将其保存到我的应用程序的本地存储文件夹,这样我就可以在程序中的其他点引用它。我只是无法弄清楚如何从对象得到它虽然文件!我发现类似的问题解决方案,为WP7,但它只是不一样的。

I have a BitmapImage object, which already has its source etc set. I simply want to save it to my apps local storage folder, so that I can reference it at other points in the program. I just cannot figure out how to get it from object to file though! I've found solutions to similar problems for WP7, but its just not the same.

Ive得到尽可能从Base64编码字符串创建我的形象(这可以作为我可以将图像加载到用户界面的图像浏览器,看看它),并把它称为 IMG ,我知道我需要得到它的 ApplicationData.Current .LocalFolder ,但我不知道如何将它转换。有谁知道?

Ive got as far as creating my image from a Base64 string (which works as I can load the image into a UI image viewer and see it) and have called it img, and I know I need to get it to ApplicationData.Current.LocalFolder, but I have no idea how to convert it. Does anyone know?

推荐答案

它是从相机UI?

var _Photo = await new CameraCaptureUI()
    .CaptureFileAsync(CameraCaptureUIMode.PhotoOrVideo);
await _Photo.MoveAsync(ApplicationData.Current.LocalFolder);



从打开的文件呢?然后你只需要:

Is it from opening the file? Then you just need:

await _Photo.MoveAsync(ApplicationData.Current.LocalFolder);



不过,如果你只是有一个BitmapImage的,你不能获得图像出来。相反,你需要回到原来的源或文件。这是唯一的方法。 参考

这篇关于保存的BitmapImage对象作为本地存储在Windows 8的文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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