【问题标题】:display images from iOS gallery显示来自 iOS 画廊的图像
【发布时间】:2014-08-12 08:20:34
【问题描述】:

通过依赖于平台的服务,我设法从设备上的一个画廊中获取图像的 NSUrl。它看起来像这样:“assets-library://asset/asset.JPG?id=01202427-4916-4F8F-99AA-D38D88181558&ext=JPG”。 如何使用它在 Xamarin.Forms 共享项目中设置 Image 视图的来源?

【问题讨论】:

    标签: ios image uiimage nsurl xamarin.forms


    【解决方案1】:

    我通过使用流解决了:

    var s = originalImage.AsPNG ().AsStream ();
    SharedView.SetImageStream(s);
    

    在PCL端:

    public void SetImageStream(System.IO.Stream s)
    {
        theImageView.Source = ImageSource.FromStream(() => s);
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-05-25
      • 2022-01-16
      • 1970-01-01
      • 1970-01-01
      • 2015-03-03
      • 1970-01-01
      • 2014-11-20
      相关资源
      最近更新 更多