image::https://img.shields.io/badge/version-1.6.1-green.svg[] image::https://img.shields.io/badge/minSDK-21-blue.svg[] image::https://img.shields.io/badge/license-MIT-yellowgreen.svg[]
If you liked the work you can think about https://www.paypal.com/donate/?hosted_button_id=MCMYPAN46SKFA[Donate via Paypal].
This library helps you to scan any document like CamScanner.
image::documentscannerMockup.png[]
Add line below to your top level build.gradle
Add lines below to your app level build.gradle
implementation 'io.github.mayuce:AndroidDocumentScanner:1.6.1'
And Sync the gradle
New version of this library provides you the gear instead of ready to go car. So you need to build your own implementation with it, before you upgrade your project make sure that you know it's gonna be a braking change in your project.
binding.documentScanner.setOnLoadListener { loading ->
binding.progressBar.isVisible = loading
}
binding.documentScanner.setImage(bitmap)
binding.btnImageCrop.setOnClickListener {
lifecycleScope.launch {
binding.progressBar.isVisible = true
val image = binding.documentScanner.getCroppedImage()
binding.progressBar.isVisible = false
binding.resultImage.isVisible = true
binding.resultImage.setImageBitmap(image)
}
}
On above Android 9.0 there is magnifier to help user to see zoomed image to crop.
If you face with any issues you can take a look at com.labters.documentscannerandroid.ImageCropActivity to see how does it works.
Thanks OpenCV for this awesome library. - https://opencv.org/
Inspiration from aashari . Thanks to him for his https://github.com/aashari/android-opencv-camera-scanner[source codes].
MIT License
Copyright (c) 2020 Muhammet Ali YUCE
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.