在android中将byteArray转换为位图?
在我的web服务中,图像以byteArray格式存储。我想转换位图图像 我在这里附上了我的代码在android中将byteArray转换为位图?,android,image,bitmap,bytearray,Android,Image,Bitmap,Bytearray,在我的web服务中,图像以byteArray格式存储。我想转换位图图像 我在这里附上了我的代码 BufferedInputStream bufferedInputStream = new BufferedInputStream(AndroidJSONParsingActivity.inputStream); Bitmap bmp = BitmapFactory.decodeStream(bufferedInputStream); ByteA
BufferedInputStream bufferedInputStream = new BufferedInputStream(AndroidJSONParsingActivity.inputStream);
Bitmap bmp = BitmapFactory.decodeStream(bufferedInputStream);
ByteArrayOutputStream companylogo = new
ByteArrayOutputStream();
ImageView image=new ImageView(this);
image.setImageBitmap(bmp);
试试这个
// Camera arg conversion to Bitmap
Bitmap background = BitmapFactory.decodeByteArray(Your_byte_array_image, 0,
Your_byte_array_image.length);
Bitmap back = Bitmap.createBitmap(background.getWidth(),
background.getHeight(), Bitmap.Config.ARGB_8888);
使用此位图 我有这么多字节数组图像如何制作成图像。对于ex徽标:[137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,0,0128,0,0,0128,8,6,0,0,0195],在我的WebService中使用json格式这可以帮助您,
// Camera arg conversion to Bitmap
Bitmap background = BitmapFactory.decodeByteArray(Your_byte_array_image, 0,
Your_byte_array_image.length);
Bitmap back = Bitmap.createBitmap(background.getWidth(),
background.getHeight(), Bitmap.Config.ARGB_8888);