How to get byte array from imageview
来源:互联网 发布:苹果5支持联通4g网络吗 编辑:程序博客网 时间:2024/05/01 03:04
ImageView iv = (ImageView) findViewById(R.id.splashImageView); Drawable d =iv.getBackground(); BitmapDrawable bitDw = ((BitmapDrawable) d); Bitmap bitmap = bitDw.getBitmap(); System.out.println(".....d....."+d); System.out.println("...bitDw...."+bitDw); System.out.println("....bitmap...."+bitmap); ByteArrayOutputStream stream = new ByteArrayOutputStream(); bitmap.compress(Bitmap.CompressFormat.JPEG, 100, stream); byte[] imageInByte = stream.toByteArray();
store byte[] in database
ContentValues cv=new ContentValues(); cv.put(CHUNK, buffer); //CHUNK blob type field of your table long rawId=database.insert(TABLE, null, cv); //TABLE table name
retrieve image from byte array[]
public static Bitmap convertByteArrayToBitmap( byte[] byteArrayToBeCOnvertedIntoBitMap) { bitMapImage = BitmapFactory.decodeByteArray( byteArrayToBeCOnvertedIntoBitMap, 0, byteArrayToBeCOnvertedIntoBitMap.length); return bitMapImage; }
- How to get byte array from imageview
- convert from to (byte [] array)
- How to get array from string contained identical symbols in Ruby?
- How to get array from string contained identical symbols in Ruby?
- How to remove Duplicates from an Array
- How to get file from classpath
- How to get parameters from the URL?
- How to get IHTMLDocument2 from a HWND
- How to get bean from tag component
- How to get UITableView from UITableViewCell?
- How to get UITableView from UITableViewCell?
- How to get kernel messages from Android?
- How to get source code from APK
- How to: Load Unmanaged Resources into a Byte Array
- How to display a byte array as hex values
- How to switch from POST to GET in PHP CURL
- How to create ArrayList (ArrayList from array (T[]) in Java
- [VB]How to get index from combo box
- 关于数组的引用类型和值类型
- Struts2.1.6以上,通过Annotation和struts2-convention-plugin.jar 实现零配置
- 图像裁剪
- C#操作IIS完整解析
- Power Designer将字段name生成为sqlserver表字段的说明
- How to get byte array from imageview
- 禅道程序员的10条原则
- vs2010连接数据库部分程序
- eclipse for php+Xdebug配置问题
- fopen打开2G以上大文件
- 《渠道商用假量冒充真实用户》后续:渠道A原来是他!
- 实时图形学学习笔记
- 个人数据管理将改变行业格局
- 怎样将excel中的数据通过PL/SQL导入ORACLE数据库中