Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从位图缩放jpg图像。压缩android_Android_Bitmap - Fatal编程技术网

从位图缩放jpg图像。压缩android

从位图缩放jpg图像。压缩android,android,bitmap,Android,Bitmap,我正在转换,位图到jpeg使用 val file = File(filePath) val fos = FileOutputStream(file) profileImageBitmap.compress(Bitmap.CompressFormat.JPEG,100,fos) jpeg看起来不错。但是它非常小。我原以为这是jpeg的有损特性,但当我尝试将位图转换为png时,它也降到了相同的大小。有没有办法增加从位图压缩的jpeg的大小?在转换为jpeg之前,可以使用createScaledBi

我正在转换,位图到jpeg使用

val file = File(filePath)
val fos = FileOutputStream(file)
profileImageBitmap.compress(Bitmap.CompressFormat.JPEG,100,fos)

jpeg看起来不错。但是它非常小。我原以为这是jpeg的有损特性,但当我尝试将位图转换为png时,它也降到了相同的大小。有没有办法增加从位图压缩的jpeg的大小?

在转换为jpeg之前,可以使用createScaledBitmap放大位图,尝试将true作为过滤器布尔值传递以获得更好的结果