【问题标题】:Image from FileOpenPicker to Base64从 FileOpenPicker 到 Base64 的图像
【发布时间】:2015-02-21 14:04:05
【问题描述】:

我正在编写 Windows Phone 8.1 应用程序 (WINRT)

我正在使用 FileOpenPicker 从图库中挑选照片,然后在 ContinueFileOpenPicker 中,如何将其转换为 Base64??

  public void ContinueFileOpenPicker(FileOpenPickerContinuationEventArgs args)
        {
            var FileOpenPickerContinuationEventArgs_File = args.Files.FirstOrDefault();

//Convert to URI
//Convert to Image
//Convert to Base64


}

【问题讨论】:

    标签: c# windows windows-phone base64 bitmapimage


    【解决方案1】:

    您可以使用Convert.ToBase64String 将图像转换为Base64

    【讨论】:

    • 它不起作用,因为 StreamResourceInfo GetResourceStream、SaveJpeg 等方法在 Windows phone 8.1 (WINRT) 中不可用
    • 为 WinRT 8.1 试用了BitmapPropertySetstackoverflow.com/questions/25994558/…
    • 谢谢,但是里面的destFileStream是什么?
    • IRandomAccessStreamObject ?如何将位图图像或 Uri 传递给此方法/任务?
    • 让我看看,然后回复你。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-03-17
    • 1970-01-01
    • 1970-01-01
    • 2017-06-21
    • 2015-03-21
    • 1970-01-01
    • 2018-09-01
    相关资源
    最近更新 更多