Get the App
SLTechnology News&Howtos  ›  Development  › 

How to save Bitmap as PNG image file in Android

Shulou Source: shulou.com Published: 2022-06-01 00:17:02 10月05日 Update

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.

Tags: Knowledge articles images documents content different big code most that is more knowledge points industry information information channels logic facets channels Tiandu reference Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MySQL Shulou Tech Info Shulou Information macOS