如何在Windows 8 Store Apps中显示文件夹中存在的图像 [英] How to display images present inside a Folder in Windows 8 Store Apps

查看:104
本文介绍了如何在Windows 8 Store Apps中显示文件夹中存在的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Windows 8商店应用程序页面(比如PhotoPage.xaml)。

在我的应用程序中,我在Assets\\Images中有一个嵌入式图像资源文件夹,其中有很多存在的图像。



现在我想在加载(或任何事件)时显示PhotoPage.xaml页面中Images文件夹内的所有图像。



我尝试了FileOpenPicker但是默认情况下无法首先加载Images文件夹中的所有图像。(我不想浏览文件夹....默认情况下,它应该只显示Image文件夹中的图像。



此外,我不必浏览其他文件夹。(我只需要图像文件夹。)



任何人都可以指出我解决这个问题的方向。非常感谢。



谢谢和问候,

解决方案

要在winRT中从应用程序的安装位置获取任何文件,您可以使用



var folder = Windows.ApplicationModel.Package.Current.InstalledLocation;
var 文件= await folder.GetFileAsync( img.jpg);





你可以运行循环以从特定位置获取所有文件并显示它。


I have a windows 8 Store App page(say PhotoPage.xaml).
In my app I have an embedded Image resource folder in "Assets\\Images" in which I have many images present.

Now I want to display all the images present inside the Images folder in the PhotoPage.xaml page when it gets loaded (or on any event).

I tried the FileOpenPicker but was unable to load all the images in the Images folder by default for first.(i dont want to browse for the folder....by default it should display the images present inside the Image folder only).

Also I dont have to browse to other folders.(I just need the Images folder alone.)

Can anyone point me a direction to the solution of this problem.Any help is appreciated.

Thanks & Regards,

解决方案

To get any file from installed location of app in winRT you can use

var folder = Windows.ApplicationModel.Package.Current.InstalledLocation;
var File = await folder.GetFileAsync("img.jpg");



You can run a loop to get all the files from a specific location and display it.


这篇关于如何在Windows 8 Store Apps中显示文件夹中存在的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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