How to resize Barcodescanner camera, or zoom the camera in/out?


#1

I am developing with Ionic 2, and using Ionic Native to scan QR Code.

The scanner works, but on Windows the scanning camera is as big as the monitor screen! Making it impossible to scan anything…

Is there any way I could zoom in or out the scanning camera? The documentation does not show any way this could be customize… so I am quite skeptical…

Here is the sample code from the documentation, all I can do is initiate the scanning and read the data:

import {BarcodeScanner} from 'ionic-native';

BarcodeScanner.scan().then((barcodeData) => {
 // Success! Barcode data is here
}, (err) => {
    // An error occurred
});

If zoom isn’t possible, could I restrict the page size so that the camera is constraint within the page size? Keep in mind I need this to work on both Android and Windows 10 (no iOS).

Thanks for any suggestion.


#2

You’d probably want to do this at the native level. You’ll need to customize the plugin for windows at that point.

Might be worth bringing up on the plugin repo


#3

Did a quick browse on the plugin source code… seems to be C#, let’s see if I can customize it…