phonegap / phonegap-plugin-barcodescanner

cross-platform BarcodeScanner for Cordova / PhoneGap
MIT License
1.27k stars 1.42k forks source link

Color of scan frame #111

Open HallmediaDigital opened 8 years ago

HallmediaDigital commented 8 years ago

Currently on IOS there is a green and red frame that indicates where to focus the scanner. Can these colors be customized. ?

BUATHERA commented 8 years ago

It would be really great to be able to customise the color/size of the overlay frame as well as the text prompt ("Place a barcode inside the viewfinder rectangle to scan it")._my app is meant only to scan qrcodes

gyugyu90 commented 8 years ago

I found out the solution.. if you go into /{ProjectFolder}/platforms/ios/{AppName}/Plugins/phonegap-plugin-barcodescanner/CDVBarcodeScanner.mm

you can customize the UI of green box and red line. almost at the end of the code, you see this:

`#define RETICLE_SIZE 500.0f

define RETICLE_WIDTH 5.0f

define RETICLE_OFFSET 60.0f

define RETICLE_ALPHA 0.4f

//------------------------------------------------------------------------- // builds the green box and red line //-------------------------------------------------------------------------

I already edited a little bit, and I got a beautiful white box and slimmer red line.

limaneto commented 7 years ago

is it possible to increase the width of the box ?

gyugyu90 commented 7 years ago

I think so.. why don't you change RETICLE_SIZE? first parameter for CGSizeMake() and third parameter for CGRectMake() are both width, so you should play with those!