saveBitmapAsFile

fun saveBitmapAsFile(bitmap: Bitmap, file: File, format: Bitmap.CompressFormat = Bitmap.CompressFormat.JPEG, @IntRange(from = 0, to = 100) quality: Int = 100): File?

Store the Bitmap object under the local cache folder.

Return

The file path after storage, or null if the storage fails.

Parameters

bitmap

The bitmap need to store.

file

The file to store the bitmap.

format

The format of the compressed image.

quality

Hint to the compressor, 0-100. The value is interpreted differently depending on the Bitmap.CompressFormat.