[UWP]如何在Windows Phone UWP中将字节数组转换为图像 [英] [UWP]How to convert byte array to image in Windows phone UWP
本文介绍了[UWP]如何在Windows Phone UWP中将字节数组转换为图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在构建远程应用程序,我的服务器向客户端发送了一个字节数组的图像,现在我想将字节数组再次转换为图像。我已经这样做但是对于客户端Windows表单但是没有在客户端UWP中运行
我需要为windows phone UWP或Silver light制作该代码
public Image byteArrayToImage(byte [] byteArrayIn)
      {
          MemoryStream ms = new MemoryStream(byteArrayIn);
          Image returnImage = Image.FromStream(ms);
          return returnImage;
      }
解决方案
检查 ImageFromBytes 功能:
https://social.msdn.microsoft.com/Forums/en-US/b5cb7ecf-3f04- 42AC-815E-c104582ab8ac 。跨度>
i'm building remote app , my server sent to the client an array of bytes of image , now i'd like to convert the byte array to the image again .i have do it but for client Windows form but that not running in client UWP
i need to make that code for windows phone UWP or Silver light
public Image byteArrayToImage(byte[] byteArrayIn){
MemoryStream ms = new MemoryStream(byteArrayIn);
Image returnImage = Image.FromStream(ms);
return returnImage;
}
解决方案
Check the ImageFromBytes function: https://social.msdn.microsoft.com/Forums/en-US/b5cb7ecf-3f04-42ac-815e-c104582ab8ac.
这篇关于[UWP]如何在Windows Phone UWP中将字节数组转换为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文