public static void saveBitmap(String filePath, Bitmap mBitmap) throws IOException {
File file = new File(filePath);
if (!file.exists()) {
file.mkdirs();
}
File imageFile = new File(file.getAbsolutePath(), "qr_image.jpg");
try {
FileOutputStream outputStream = new FileOutputStream(imageFile);
mBitmap.compress(Bitmap.CompressFormat.JPEG, 90, outputStream);
outputStream.flush();
outputStream.close();
} catch (Exception e) {
e.printStackTrace();
}
}
Android保存图片
最新推荐文章于 2023-06-28 13:56:50 发布