获取斑点图像转换的图像转换成位图图像 [英] Get Blob image and convert that image into Bitmap image

查看:113
本文介绍了获取斑点图像转换的图像转换成位图图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到的图像从数据库中的BLOB格式。我想将其转换成用位图转换为BLOB是把below.but请告诉我如何扭转它的位图形象。$ C $词。???

  ByteArrayOutputStream蟒蛇=新ByteArrayOutputStream();
btmap.com preSS(Bitmap.Com pressFormat.JPEG,100,蟒蛇); // BM是位图对象
byte []的byteArrayImage =蟒蛇.toByteArray();
字符串连接codeDIMAGE = Base64.en codeToString(byteArrayImage,Base64.DEFAULT);
 

解决方案

这将工作

 字节[]的字节数组= DBcursor.getBlob(参数:columnIndex);

位图BM = BitmapFactory.de codeByteArray(字节数组,0,byteArray.length);
 

I am getting image from database in blob format. i want to convert it into Bitmap image.the code i used to convert bitmap to Blob is put below.but please tell me how to reverse it.???

ByteArrayOutputStream boas = new ByteArrayOutputStream();  
btmap.compress(Bitmap.CompressFormat.JPEG, 100, boas ); //bm is the bitmap object   
byte[] byteArrayImage = boas .toByteArray(); 
String encodedImage = Base64.encodeToString(byteArrayImage, Base64.DEFAULT);

解决方案

This will work

byte[] byteArray = DBcursor.getBlob(columnIndex);  

Bitmap bm = BitmapFactory.decodeByteArray(byteArray, 0 ,byteArray.length);

这篇关于获取斑点图像转换的图像转换成位图图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆