The code below get image from some location – and make this image compress image.
But i need to make the compress Image to be File … How can i do it ?
File compressFile = null;
File file = new File("MyFile");
OutputStream fOut = new FileOutputStream(file);
if(image.compress(Bitmap.CompressFormat.PNG, 100, fOut))
{
fOut.flush();
fOut.close();
compressFile = ??? // I need here to make the OutputStream to be back to file.
}
image.compressalready writes the image to the file, assuming you gave a correct file name.So use it like this: