android Bitmap保存到文件(PNG)
2015-07-27 21:16
561 查看
private void saveMyBitmap(String bitName,Bitmap mBitmap){ File f = new File(DB_PATH + bitName + ".png"); try { f.createNewFile(); } catch (IOException e) { } FileOutputStream fOut = null; try { fOut = new FileOutputStream(f); } catch (FileNotFoundException e) { e.printStackTrace(); } mBitmap.compress(Bitmap.CompressFormat.PNG, 100, fOut); try { fOut.flush(); } catch (IOException e) { e.printStackTrace(); } try { fOut.close(); } catch (IOException e) { e.printStackTrace(); } }
相关文章推荐
- android之GMS认证
- android 常见分辨率(mdpi、hdpi 、xhdpi、xxhdpi )
- Android小项目之 where are you 监控
- android 摄像头 拍照
- Android中的各种layout属性
- android中最先被执行的activity
- AndroidManifest.xml - 【 manifest -> application】
- Android下利用zxing类库实现扫一扫
- android坐标
- Android studio项目结构目录详解
- android----通信录操作
- android 编程下 Touch 事件的分发和消费机制
- Android studio中使用asmack的jar包的前期准备工作
- 在Android中如何侦听Service内部的状态
- android 错误提示---解决办法
- Android Service Bind with Activity
- Android之——手机黑名单的实现
- Android中的5种数据存储方式之——文件存储数据
- 《深入了解Android:Wi-Fi、NFC和GPS音量》勘误表
- android的事物