How to save Bitmap as PNG image file in Android
Today, I would like to share with you how to save Bitmap as a PNG image file in Android. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.
The specific code is as follows:
Public static void saveBitmapAsPng (Bitmap bmp,File f) {try {FileOutputStream out = new FileOutputStream (f); bmp.compress (Bitmap.CompressFormat.PNG, 100,100, out); out.flush (); out.close ();} catch (FileNotFoundException e) {e.printStackTrace ();} catch (IOException e) {e.printStackTrace () }} these are all the contents of the article "how to save Bitmap as an PNG image file in Android". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.