android 保存bitmap到SD卡

public void saveMyBitmap(String bitName,Bitmap mBitmap){
File f = new File(Environment.getExternalStorageDirectory()					, fileName);
			FileOutputStream fOut = null;
			try {
				f.createNewFile();
				fOut = new FileOutputStream(f);
			} catch (IOException e) {
				e.printStackTrace();
			}
			mBitmap.compress(Bitmap.CompressFormat.PNG, 100, fOut);
			try {
				fOut.flush();
				fOut.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
}


你可能感兴趣的:(android 保存bitmap到SD卡)