据我所知,使用 BitmapFactory
可以将文件转换为位图,但有什么办法一个位图图像转换成一个文件?
I understand that using BitmapFactory
can convert a File to a Bitmap, but is there any way to convert a Bitmap image to a File?
试试这个:
bitmap.compress(Bitmap.CompressFormat.PNG, quality, outStream);
检查http://developer.android.com/reference/android/graphics/Bitmap.html#com$p$pss(android.graphics.Bitmap.Com$p$pssFormat,%20int,%20java.io.OutputStream%29