AVCaptureMetadataOutput change area of scanning

I’m trying AVCaptureMetadataOutput for scanning barcodes. I want to scan barcode from the whole AVCaptureVideoPreviewLayer but it scans only from the center point of the AVCaptureVideoPreviewLayer, i want to change the AVCaptureMetadataOutput rect and i used the following code for that but it did not change the rect.

CGRect layerRect = [[[self view] layer] bounds];

CGRect visibleMetadataOutputRect = [_prevLayer metadataOutputRectOfInterestForRect:layerRect];
_output.rectOfInterest = visibleMetadataOutputRect;

i also provide the landscape scanning so i am transfroming the layer when user change the orientation.

Source: ios

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.