当前位置: 代码迷 >> Android >> Android-保存Bit地图到SDCard
  详细解决方案

Android-保存Bit地图到SDCard

热度:52   发布时间:2016-05-01 15:31:12.0
Android-保存Bitmap到SDCard
public void saveMyBitmap(String bitName, Bitmap mBitmap) throws IOException {          File f = new File("/sdcard/" + bitName + ".png");          f.createNewFile();          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();          }  }  
  相关解决方案