From a5ef3226e6eb978307bd34444234ba9260814731 Mon Sep 17 00:00:00 2001 From: Robert Sasak Date: Mon, 3 May 2021 11:35:41 +0200 Subject: [PATCH 1/2] Implement pinch to zoom --- example/App.js | 2 +- ios/ALPRCamera.m | 13 ++++++++++--- ios/ALPRCameraManager.h | 1 + ios/ALPRCameraManager.mm | 30 ++++++++++++++++++++++++++++++ 4 files changed, 42 insertions(+), 4 deletions(-) diff --git a/example/App.js b/example/App.js index 7633b7f..ab3af8d 100644 --- a/example/App.js +++ b/example/App.js @@ -317,7 +317,7 @@ export default class App extends Component { {plate} - {confidence ? confidence + '%' : ''} + {confidence ? (+confidence).toFixed(1) + '%' : ''} device.activeFormat.videoMaxZoomFactor) { + zoomFactor = device.activeFormat.videoMaxZoomFactor; + } else if (zoomFactor < 1) { + zoomFactor = 1.0f; + } + + NSDictionary *event = @{ + @"target": reactTag, + @"zoomFactor": [NSNumber numberWithDouble:zoomFactor], + @"velocity": [NSNumber numberWithDouble:velocity] + }; + + [self.bridge.eventDispatcher sendAppEventWithName:@"zoomChanged" body:event]; + + device.videoZoomFactor = zoomFactor; + [device unlockForConfiguration]; + } else { + NSLog(@"error: %@", error); + } +} + - (void)setCaptureQuality:(NSString *)quality { #if !(TARGET_IPHONE_SIMULATOR) From bb41122fb7580acabff20efbec0b16124dba9553 Mon Sep 17 00:00:00 2001 From: Robert Sasak Date: Tue, 4 May 2021 11:31:12 +0200 Subject: [PATCH 2/2] Update README.md --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6ed201c..3076998 100644 --- a/README.md +++ b/README.md @@ -284,3 +284,7 @@ Note: If you are getting errors, double check that you have completed all of the - OpenALPR built from [OpenALPR-iOS](https://github.com/twelve17/openalpr-ios) - Project scaffold based on [react-native-camera](https://github.com/lwansbrough/react-native-camera) + +## Sponsors + +- [repocoin.io](https://repocoin.io)