How to save image in BMP format?

I know that I have to use the compress method to save the raster file.

FileOutputStream fos = new FileOutputStream(imagefile); bitmap.compress(Bitmap.CompressFormat.PNG, 100, fos); fos.flush(); fos.close(); 

but I want to save my image in BMP format, while "Bitmap.CompressFormat" only supports PNG and JPEG. How to save image file in BMP format?

Thanks,

+4
source share
1 answer

you can use copyPixelsToBuffer

to save a raster pixel to the buffer and than write the buffer in sd.

+1
source

All Articles