1

I am using Zxing library to get QR code from QR image. I can get QR code after scanning image. I want to get the image as bitmap with its code/information also. How can I achieve this?

I open the scan activity, calling like:

                Intent intent = new Intent(
                        "com.google.zxing.client.android.SCAN");
                intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
                startActivityForResult(intent, 0);

I tried to explore the CaptureActivity which is inside the Zxing library. I found the handleDecodeExternally method . It has a parameter Bitmap barcode. Does this parameter contains scanned picture bitmap? If yes, then I have to send this with Intent when leaving the CaptureActivity?

Edited and updated: After I edited below method on CaptureActivity

handleDecodeExternally(Result rawResult,
        ResultHandler resultHandler, Bitmap barcode)

and send Bitmap barcode to my activity via Intent I found the bitmap which is total camera view on scanning mode. Not the QR Image. So, I can't found to get the QR image what I scanned .

Cœur
  • 37,241
  • 25
  • 195
  • 267
Shihab Uddin
  • 6,699
  • 2
  • 59
  • 74

1 Answers1

0

Unfortunately ZXing doesn't return bitmap by default in its bundle, a good solution would be to git a version of the source code, and store the bitmap CaptureActivity.handleDecode seems to be the right place to save the bitmap or pass it to your calling activity.

here is a tutorial on how to integrate ZXing in your app: ZXing tutorial and here is link To ZXing project on google code

Mr.Me
  • 9,192
  • 5
  • 39
  • 51