首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FileOpenPicker windows 10移动版

FileOpenPicker windows 10移动版
EN

Stack Overflow用户
提问于 2017-01-15 09:08:38
回答 1查看 213关注 0票数 0

我想做一个我想使用FileOpenPicker的uwp应用程序,但该应用程序只能在windows 10上运行,而不能在windows 10 mobile上运行

在Windows10移动我的应用程序crash...and上,异常消息是:“找不到元素。(来自HRESULT的异常: 0x80070490)”

这是我的代码:

代码语言:javascript
复制
        FileOpenPicker openPicker = new FileOpenPicker();
        openPicker.ViewMode = PickerViewMode.Thumbnail;
        openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
        openPicker.FileTypeFilter.Add(".jpg");
        openPicker.FileTypeFilter.Add(".jpeg");
        openPicker.FileTypeFilter.Add(".png");

        StorageFile file = await openPicker.PickSingleFileAsync();

        if (file != null)

        {

            var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);

            var image = new BitmapImage();

            ImageBrush ib = new ImageBrush();
            ib.ImageSource = image;

            image.SetSource(stream);

            var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
            var filePath = file.Path;
            localSettings.Values["monimage"] = filePath;

            set.Background = new ImageBrush { ImageSource = image, Stretch = Stretch.UniformToFill };

        }

        else

        {

            //

        }

我已经在Windows10Mobile 10.0.14393.693上测试了我的应用程序,我没有可能在其他Windows10Mobile版本上测试,但我认为问题不是Windows10版本,而是我的代码……

EN

回答 1

Stack Overflow用户

发布于 2017-01-17 05:26:41

我自己解决了这个问题,我测试了商店里使用FileOpenPicker的其他应用程序,他们都有相同的错误,所以我重新安装了Windows10移动版,现在一切正常:)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41656792

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档