Software Archive
Read-only legacy content
17061 Discussions

Get QR code corner points coordinates

Alan_A_1
Beginner
842 Views

Hi everyone!

This is my first post so please be patient if my question is too basic :)

I saw this tutorial (http://qnimate.com/create-a-barcode-scanner-application-using-intel-xdk-and-php/) to make a barcode scanner and its amazing how easy is but now I want to get the coordinates of each corner points to draw lines on borders:

Red line for the upper side, green line for right side, blue line for left side and white line for bottom side.

Anybody knows how can I achieve it?

This is the link code:

<!DOCTYPE html>
<html>
<head>
    <title>Blank Hybrid App Project Template</title>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <style>
        @-ms-viewport { width: 100vw ; zoom: 100% ; }                           
        @viewport { width: 100vw ; zoom: 100% ; }
        @-ms-viewport { user-zoom: fixed ; }                                    
        @viewport { user-zoom: fixed ; }
    </style>
    <script src="lib/ft/fastclick.js"></script>
    <link rel="stylesheet" href="css/app.css">
</head>
<body>
    <button onclick="scanNow();">Scan</button>  
    <script src="intelxdk.js"></script>         
    <script src="cordova.js"></script>          
    <script src="xhr.js"></script>              
    <script src="js/app.js"></script>
    <script src="js/init-app.js"></script>
    <script src="js/init-dev.js"></script>
    <script>
        function scanNow()
        {
            intel.xdk.device.scanBarcode();
        }
        document.addEventListener("intel.xdk.device.barcode.scan",function(evt){
            if (evt.success == true) {
                alert(evt.codedata);
            }
            else 
            {
                alert("Please try again");
            }
        },false);
    </script>
</body>
</html>

If its not possible, do you think it would be possible with zxing and how?

Thank you all.

0 Kudos
1 Solution
Rakshith_K_Intel
Employee
842 Views

That screen with camera is part of the plugin, you have to make that change in the plugin's ios and android code.

Here is the source to the cordova plugin that has the barcode scanner: https://github.com/01org/cordova-plugin-intel-xdk-device

(the barcode scanner code was removed in last checkin, u may have to pull, undo last couple commits and then look at the code to modify)

 

 

 

View solution in original post

0 Kudos
4 Replies
Rakshith_K_Intel
Employee
842 Views

Are you trying to add boundary on the QR scanner overlay ?

0 Kudos
Alan_A_1
Beginner
842 Views

Yes, that is what I want, even if the qr code is bow-legged like the windows phone default qr reader app:

qr1.jpg

 

0 Kudos
Rakshith_K_Intel
Employee
843 Views

That screen with camera is part of the plugin, you have to make that change in the plugin's ios and android code.

Here is the source to the cordova plugin that has the barcode scanner: https://github.com/01org/cordova-plugin-intel-xdk-device

(the barcode scanner code was removed in last checkin, u may have to pull, undo last couple commits and then look at the code to modify)

 

 

 

0 Kudos
Alan_A_1
Beginner
842 Views

Thanks Rakshith, I´ll try it

0 Kudos
Reply