Last active
December 19, 2019 05:12
-
-
Save m-kikuchi777/b6863b726a7c99ebb819c8dd6431391f to your computer and use it in GitHub Desktop.
Scoped Storage Read with BitmapFactory.Options
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val bitmapFactoryOptions = BitmapFactory.Options() | |
bitmapFactoryOptions.inSampleSize = sampleSize | |
var bitmap = contentResolver.openFileDescriptor(path, "r")?.use { | |
BitmapFactory.decodeFileDescriptor(it.fileDescriptor, null, bitmapFactoryOptions) | |
} ?: return null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment