String和bitmap相互转换
来源:互联网 发布:在线网络投资可靠吗 编辑:程序博客网 时间:2024/06/05 17:30
/** * 图片转成string * * @param bitmap * @return */public static String convertIconToString(Bitmap bitmap){ByteArrayOutputStream baos = new ByteArrayOutputStream();// outputstreambitmap.compress(CompressFormat.PNG, 100, baos);byte[] appicon = baos.toByteArray();// 转为byte数组return Base64.encodeToString(appicon, Base64.DEFAULT);}/** * string转成bitmap * * @param st */public static Bitmap convertStringToIcon(String st){// OutputStream out;Bitmap bitmap = null;try{// out = new FileOutputStream("/sdcard/aa.jpg");byte[] bitmapArray;bitmapArray = Base64.decode(st, Base64.DEFAULT);bitmap =BitmapFactory.decodeByteArray(bitmapArray, 0,bitmapArray.length);// bitmap.compress(Bitmap.CompressFormat.PNG, 100, out);return bitmap;}catch (Exception e){return null;}}
0 0
- String和bitmap相互转换
- BitMap 和 Drawable 相互转换
- Drawable和Bitmap相互转换
- Bitmap和File相互转换
- Android Bitmap与String的相互转换
- Bitmap和Drawable相互转换方法
- Bitmap和Drawable相互转换方法
- Bitmap和Drawable相互转换方法
- Bitmap和Drawable之间的相互转换
- Android Bitmap和Drawable相互转换方法
- Bitmap和Drawable相互转换方法
- Bitmap和Drawable相互转换方法
- Bitmap和Drawable相互转换方法!!!
- Android Bitmap和Drawable相互转换方法
- Bitmap和Drawable相互转换方法
- Bitmap和Drawable相互转换方法
- Bitmap和Drawable相互转换方法
- android:Bitmap和Drawable相互转换方法
- MATLAB 路径设置
- 在Mifare S50中,如果第2区的访问控制码为FF 08 70 69,分析该区块1和3的访问的控制条件
- 互斥锁和条件变量
- python标准库之SocketServer
- 如何精心打造一句15字的战略宣言?
- String和bitmap相互转换
- ibatis批处理
- 三月份值得关注的10家新创公司【国外榜单】
- 浅析C指针(一)
- php执行命令的函数和方法
- Dbus : simple sender and receiver
- 第19课时,实践1,编写一个程序,从键盘上输入一个小写字母,显示这个小写字母及它所对应的大写字母以及它们的ASCII码值
- eclipse c/c++IDE 编译 make: *** No rule to make target `all'. Stop. 解决办法
- 查看oracle系统临时表空间、undo表空间、SGA和PGA大小