Change the scan area of ​​AVCaptureMetadataOutput

I am trying to execute AVCaptureMetadataOutput to scan barcodes. I want to scan a barcode from all over AVCaptureVideoPreviewLayer , but it only scans from the center point of AVCaptureVideoPreviewLayer , I want to change AVCaptureMetadataOutput rect and I used the following code for this, but it did not change rect.

CGRect layerRect = [[[self view] layer] bounds]; CGRect visibleMetadataOutputRect = [_prevLayer metadataOutputRectOfInterestForRect:layerRect]; _output.rectOfInterest = visibleMetadataOutputRect; 

I also provide landscape scanning, so I transform the layer when the user changes orientation.

+5
source share

All Articles