如何将字节数组转换为图像&在GridView中显示 [英] How to convert byte array to image & display in GridView
本文介绍了如何将字节数组转换为图像&在GridView中显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我的网络服务将返回字节数组.
现在,
我需要将其转换为图像,并且需要将该图像显示为
GridView控件.
我该怎么办?
在Advance中致谢
Hi All,
My webservice will return the bytearray.
Now,
I need to convert it into Image & i need to display that image into
GridView control.
How can i do this?
Thanks in Advance
推荐答案
选中此
C#图像到字节数组和字节数组到图像转换器类 [ ^ ]
Check this
C# Image to Byte Array and Byte Array to Image Converter Class[^]
public Image byteArrayToImage(byte[] byteArrayIn)
{
MemoryStream ms = new MemoryStream(byteArrayIn);
Image returnImage = Image.FromStream(ms);
return returnImage;
}
这篇关于如何将字节数组转换为图像&在GridView中显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文