转自:http://blog.csdn.net/cbirdlg/article/details/5896037

public void saveMyBitmap(String bitName,Bitmap mBitmap){
File f = new File("/sdcard/" + bitName + ".png");
try {
f.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
DebugMessage.put("在保存图片时出错:"+e.toString());
}
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();
}
}

一个方法,比较简单

更多相关文章

  1. 浅谈Java中Collections.sort对List排序的两种方法
  2. Python list sort方法的具体使用
  3. python list.sort()根据多个关键字排序的方法实现
  4. android上一些方法的区别和用法的注意事项
  5. android实现字体闪烁动画的方法
  6. Android中dispatchDraw分析
  7. Android四大基本组件介绍与生命周期
  8. Android(安卓)MediaPlayer 常用方法介绍
  9. 在Fragment中设置控件点击方法,执行失败。

随机推荐

  1. android中自定义标签ImageButton
  2. Cocos2d-x开发移植到安卓平台横竖屏设置
  3. android wifi工作流程
  4. Android封装BaseFragment
  5. android BitmapFactory的内存溢出
  6. Tensorflow:Android调用Tensorflow Mobile
  7. [android]_[Async异步任务使用]
  8. Android培训班(22)
  9. OpenCV Android开发环境搭建
  10. Android中利用Application实现多个Activi