creating .bmp image file from Bitmap class
问题 I've created an application that uses sockets in which the client receives the image and stores the data of the image in Bitmap class.... Can anyone please tell me how to create a file named myimage.png or myimage.bmp from this Bitmap object String base64Code = dataInputStream.readUTF(); byte[] decodedString = null; decodedString = Base64.decode(base64Code); Bitmap bitmap = BitmapFactory.decodeByteArray(decodedString, 0,decodedString.length); 回答1: Try following code to save image as PNG