2012-03-08 17 views
0

嘿,我需要显示在我的Android插槽读取图像application.The Android应用程序基本上是接收从java server.The Java服务器映像客户端写入PNG文件使用ImageIO.write() function.I是新到Android。可有人请帮我需要显示通过套接字收到的图像机器人

+0

在计算器 http://stackoverflow.com/questions/8939868/how-to-send-and-receive-image-through-socket已经参考此答案 – SHANib 2012-03-08 06:52:10

回答

1

先读取图像成byte []数组,然后使用BitmapFactory字节构造位图。它可能是这个样子:

byte[] buffer = new byte[imgSize]; 

//read all data to the buffer 

BitmapFactory.decodeByteArray(buffer, 0, buffer.length); 
相关问题