uriToBitmap改为使用RGB_565

This commit is contained in:
2025-11-28 10:43:06 +08:00
parent 5b7b73dd55
commit c70ed8813d
@@ -14,8 +14,8 @@ object ImageUtil {
// options.inPreferredConfig = Bitmap.Config.ARGB_8888 // options.inPreferredConfig = Bitmap.Config.ARGB_8888
options.inPreferredConfig = Bitmap.Config.RGB_565 options.inPreferredConfig = Bitmap.Config.RGB_565
context.contentResolver.openInputStream(uri)?.use { stream -> context.contentResolver.openInputStream(uri)?.use { stream ->
// BitmapFactory.decodeStream(stream, null, options) BitmapFactory.decodeStream(stream, null, options)
BitmapFactory.decodeStream(stream) // BitmapFactory.decodeStream(stream)
} }
} catch (e: Exception) { } catch (e: Exception) {
e.printStackTrace() e.printStackTrace()