Click here to Skip to main content
15,880,392 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
get tiff file through cursor and want to display...

What I have tried:

<pre lang="Kotlin">

val tiffImage = TiffImage()
        var inputStream: InputStream? = null
        try {
            inputStream = assets.open(file.toString())
            val bytes: ByteArray = inputStream2Byte(inputStream)
            val byteArrayInputStream = ByteArrayInputStream(bytes)
            bitmap = tiffImage.decode(byteArrayInputStream)!!
        } catch (e: IOException) {
            e.printStackTrace()
        }
        tiffImage.release()
        binding.tiffIV.setImageBitmap(bitmap)
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900