public void saveMyBitmap(String bitName,Bitmap mBitmap){
File f = new File("/sdcard/课程设计/" + bitName + ".jpg");
try {
f.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
}
FileOutputStream fOut = null;
try {
fOut = new FileOutputStream(f);
} catch (Exception e) {
e.printStackTrace();
}
mBitmap.compress(Bitmap.CompressFormat.JPEG, 100, fOut);
try {
fOut.flush();
} catch (IOException e) {
e.printStackTrace();
}
try {
fOut.close();
} catch (IOException e) {
e.printStackTrace();
}
}
Andorid在指定文件夹中保存图片
最新推荐文章于 2021-05-29 00:06:07 发布