ZXing double image/overlay after scan

Dima

I am using the ZXing library, fully integrated with jar files, in my Android app and have the following problem:

Problem:

After scanning a barcode, the scanned image stays on top on the live camera feed at about 50% transparency for about 1-2 seconds.

Question:

Is there any way to have just the scanned image appear at 0% transparency, instead of the strange overlay? Or, even better, can it show a custom fragment?

Thank you.

Code: [w/o unrelated parts]

public static void initiateScan(Fragment fragment) {
    IntentIntegrator ii = new IntentIntegrator(fragment);
    DisplayMetrics dm = fragment.getResources().getDisplayMetrics();
    ii.addExtra("SCAN_WIDTH", dm.heightPixels);
    ii.addExtra("SCAN_HEIGHT", dm.widthPixels / 4);
    ii.addExtra("SCAN_MODE", "ONE_D_MODE");

    List<String> c = new ArrayList<String>();
    c.add("CODE_39");

    ii.initiateScan(c, -1);
}

public void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if(requestCode==IntentIntegrator.REQUEST_CODE) { // scan from ZXing
        String raw_vin=null;
        String vin = null;
        boolean success=false;

        IntentResult result = IntentIntegrator.parseActivityResult(requestCode, 
                                resultCode, data);
        if(result!=null)
        {
            String content = result.getContents();
            if(content!=null)
            {
                raw_vin=content;
                vin=raw_vin;
                success=true;
            }
        }
    }
}

Example:

Example of double image

Ray Hunter

Here is what I have in the build.gradle file for dependencies:

compile 'com.google.zxing:core:3.2.1'
compile 'com.journeyapps:zxing-android-embedded:3.0.3@aar'

Try this in the initiateScan method:

public static void initiateScan(Fragment fragment) {
    IntentIntegrator ii = IntentIntegrator.forSupportFragment(fragment);
    DisplayMetrics dm = fragment.getResources().getDisplayMetrics();
    ii.addExtra("SCAN_WIDTH", dm.heightPixels);
    ii.addExtra("SCAN_HEIGHT", dm.widthPixels / 4);
    ii.addExtra("SCAN_MODE", "ONE_D_MODE");
    ii.initiateScan(Collections.singletonList("CODE_39"));
}

Let me know how that works for you.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Setting a TextView after Zxing scan is not doing anything

From Dev

Misterious dialog pops up after to scan a qr code with zxing library

From Dev

Xamarin.Forms ZXing.Net.Mobile loosing current page after scan result on iOS 10

From Dev

ZXing scan by intent, download app without scanning

From Dev

Serial scan using Zxing library - android

From Dev

intermittent QR Scan results using ZXing IntentIntegrator

From Dev

How to scan barcode with zxing and return with jsonp?

From Dev

zxing minimum size on screen of qr to scan

From Dev

ZXing.Net.Mobile scan doesn't trigger

From Dev

scan the barcode reader data using zxing in android app

From Dev

Scan the QR code picture directly from camera with ZXing

From Dev

QR scan in a half screen using zxing library xamarin android

From Dev

UnsupportedCharsetException: Cp437 after zxing update

From Dev

Android ZXing waiting time after decoding an image

From Dev

Android I use Zxing Qr code, how to scan local Qr code image?

From Dev

ZXing QR code scanner embedded pressing back button during scan issue

From Dev

Is it possible to stretch a imageOverlay in leaflet?

From Dev

qrcode scanner a sample from zxing is not returning to onActivityResult after scanning

From Dev

android launch zxing scanner only after entering fragment

From Dev

How to track the data after scanning in zxing QR code library?

From Dev

Android listing BLE devices after device scan

From Dev

Android listing BLE devices after device scan

From Dev

Executing print statement after scan statement in C

From Dev

Cmd quits after mbam scan and quarantine

From Dev

The letter after Double Quotes

From Dev

How do I scan a thousand double sided pages into a PDF?

From Dev

how to use scanf to scan double and char at the same time into a double array in C

From Dev

Double action after meeting condition

From Dev

Removing double quotes after json

Related Related

  1. 1

    Setting a TextView after Zxing scan is not doing anything

  2. 2

    Misterious dialog pops up after to scan a qr code with zxing library

  3. 3

    Xamarin.Forms ZXing.Net.Mobile loosing current page after scan result on iOS 10

  4. 4

    ZXing scan by intent, download app without scanning

  5. 5

    Serial scan using Zxing library - android

  6. 6

    intermittent QR Scan results using ZXing IntentIntegrator

  7. 7

    How to scan barcode with zxing and return with jsonp?

  8. 8

    zxing minimum size on screen of qr to scan

  9. 9

    ZXing.Net.Mobile scan doesn't trigger

  10. 10

    scan the barcode reader data using zxing in android app

  11. 11

    Scan the QR code picture directly from camera with ZXing

  12. 12

    QR scan in a half screen using zxing library xamarin android

  13. 13

    UnsupportedCharsetException: Cp437 after zxing update

  14. 14

    Android ZXing waiting time after decoding an image

  15. 15

    Android I use Zxing Qr code, how to scan local Qr code image?

  16. 16

    ZXing QR code scanner embedded pressing back button during scan issue

  17. 17

    Is it possible to stretch a imageOverlay in leaflet?

  18. 18

    qrcode scanner a sample from zxing is not returning to onActivityResult after scanning

  19. 19

    android launch zxing scanner only after entering fragment

  20. 20

    How to track the data after scanning in zxing QR code library?

  21. 21

    Android listing BLE devices after device scan

  22. 22

    Android listing BLE devices after device scan

  23. 23

    Executing print statement after scan statement in C

  24. 24

    Cmd quits after mbam scan and quarantine

  25. 25

    The letter after Double Quotes

  26. 26

    How do I scan a thousand double sided pages into a PDF?

  27. 27

    how to use scanf to scan double and char at the same time into a double array in C

  28. 28

    Double action after meeting condition

  29. 29

    Removing double quotes after json

HotTag

Archive