File f = new File("/sdcard/DCIM/Camera/0.png");
                       FileOutputStream fos = null;
                       try {
                           fos = new FileOutputStream(f);
                           drawBitmap.compress(Bitmap.CompressFormat.PNG, 50, fos);
                       } catch (FileNotFoundException e) {
                           // TODO Auto-generated catch block
                           e.printStackTrace();
                       }

 

<!-- 在SDCard中创建与删除文件权限 -->     
<uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"/>     
<!-- 往SDCard写入数据权限 -->     
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

参考:http://wuxiaolong.me/2015/04/23/CanvasToPhoto/

相关文章:

  • 2022-01-01
  • 2021-09-20
  • 2022-03-03
  • 2021-12-26
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2022-02-13
猜你喜欢
  • 2022-12-23
  • 2022-02-10
  • 2022-12-23
  • 2022-12-23
  • 2022-01-03
  • 2021-12-07
  • 2022-12-23
相关资源
相似解决方案