0
override fun onImageSaved(output: ImageCapture.OutputFileResults){
    val image: InputImage
    try {
        image = output.savedUri?.let { InputImage.fromFilePath(baseContext, it) }!!
        if (image != null) {
            //what to put here to convert the image that i got from a uri into a bitmap to pass in the        //           function below

            getRoundedCroppedBitmap(bitmap)
        }

I dont know what code to use to create a bitmap from variable image in the above code.

//val buffer: ByteBuffer = image.planes!![0].buffer
//val bytes = ByteArray(buffer.capacity())
//buffer.get(bytes)
//val bitmap = BitmapFactory.decodeByteArray(bytes, 0, bytes.size, null)

i tried this where the comment is in the aboce code but I get null exception error, and it doesnt work

Adel
  • 1
  • 1

0 Answers0