首页 > 其他 > 详细

FileOutputStream保存文件

时间:2016-08-13 14:09:57      阅读:217      评论:0      收藏:0      [点我收藏+]
//保存文件,根据传入的路径,存放在SD卡目录下
public
boolean saveToPath(String title, String pageName) { Bitmap b = getChartBitmap(); OutputStream stream = null; try { stream = new FileOutputStream(Environment.getExternalStorageDirectory().getPath() +pageName+ "/" + title + ".png"); /* * Write bitmap to file using JPEG or PNG and 40% quality hint for * JPEG. */ b.compress(CompressFormat.PNG, 40, stream); stream.close(); } catch (Exception e) { e.printStackTrace(); return false; } return true; }

 

FileOutputStream保存文件

原文:http://www.cnblogs.com/kingsam/p/5767832.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!