public class BitmapToFile { public ArrayList<String> bitmapToFile(Bitmap signatureBitmap, String new_path, ArrayList<String> pics_result_List) { String yyyyMMdd_hHmm = new SimpleDateFormat("yyyyMMdd_HHmm").format(new Date()); String loadPic_path = new_path + "/" + yyyyMMdd_hHmm + "_IMG.jpg"; File loadPic_file = new File(loadPic_path); try { BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(loadPic_file)); signatureBitmap.compress(Bitmap.CompressFormat.JPEG, 100, bos); bos.flush(); bos.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } pics_result_List.add(loadPic_path); // pics_files.add(loadPic_file); return pics_result_List; } }
Bitmap转path
最新推荐文章于 2022-01-26 10:15:17 发布