/**
* 将BitMap转成Jpeg图片保存到sdcard(便于以后debug调试查看和裁切调试)
*/
private void saveBitmap(Bitmap bitmap, String FileName) throws IOException {
File file = new File("/sdcard/" + "1111test" + ".jpg");
if (file.exists()) {
file.delete();
}
FileOutputStream out;
try {
out = new FileOutputStream(file);
if (bitmap.compress(Bitmap.CompressFormat.PNG, 90, out)) {
out.flush();
out.close();
}
} catch (FileNotFoundException e) {
e.printStackTrace();
Log.d("file_save = ", "file_save_fail FileNotFoundException !!!!!!");
} catch (IOException e) {
e.printStackTrace();
Log.d("file_save = ", "file_save_fail IOException !!!!!!");
}
}