Save bitmap to location

前端 未结 19 2392
悲哀的现实
悲哀的现实 2020-11-22 00:20

I am working on a function to download an image from a web server, display it on the screen, and if the user wishes to keep the image, save it on the SD card in a certain fo

19条回答
  •  有刺的猬
    2020-11-22 00:50

    Hey just give the name to .bmp

    Do this:

    ByteArrayOutputStream bytes = new ByteArrayOutputStream();
    _bitmapScaled.compress(Bitmap.CompressFormat.PNG, 40, bytes);
    
    //you can create a new file name "test.BMP" in sdcard folder.
    File f = new File(Environment.getExternalStorageDirectory()
                            + File.separator + "**test.bmp**")
    

    it'll sound that IM JUST FOOLING AROUND but try it once it'll get saved in bmp foramt..Cheers

提交回复
热议问题