Android把Bitmap保存为PNG图像文件的简单方法(同步)

我会带着你远行 2024-02-17 23:19 81阅读 0赞
  1. public static void saveBitmapAsPng(Bitmap bmp,File f) {
  2. try {
  3. FileOutputStream out = new FileOutputStream(f);
  4. bmp.compress(Bitmap.CompressFormat.PNG, 100, out);
  5. out.flush();
  6. out.close();
  7. } catch (FileNotFoundException e) {
  8. e.printStackTrace();
  9. } catch (IOException e) {
  10. e.printStackTrace();
  11. }
  12. }

发表评论

表情:
评论列表 (有 0 条评论,81人围观)

还没有评论,来说两句吧...

相关阅读