File f = new File("/sdcard/kkpy/image" + getString(etv_name) + ".png");
try {
f.createNewFile();
} catch (IOException e) {
// TODO Auto-generated catch block
System.out.println("在保存图片时出错:" + e.toString());
}
FileOutputStream fOut = null;
try {
fOut = new FileOutputStream(f);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
QR_bmp.compress(Bitmap.CompressFormat.PNG, 100, fOut);
try {
fOut.flush();
} catch (IOException e) {
e.printStackTrace();
}
try {
fOut.close();
} catch (IOException e) {
e.printStackTrace();
}
保存bitmap到sdcard
最新推荐文章于 2021-05-27 02:29:24 发布