How to crop scanned barcode using Zbar?

前端 未结 1 643
说谎
说谎 2021-02-11 02:06

I am using below code to scan bar code using Zbar sdk.

I go through related question of stackoverflow but that answer is not working for me.

Till now I have done

相关标签:
1条回答
  • 2021-02-11 02:54

    Try this. If CGRect = CGRectMake(x, y, width, height);, then do:

    float A = y / readerView.bounds.size.height;   
    float B = 1 - (x + width) / readerView.bounds.size.width;   
    float C = (y + height) / readerView.bounds.size.height;   
    float D = 1 - x / readerView.bounds.size.width;;  
    CGRectMake( A, B, C, D );
    
    0 讨论(0)
提交回复
热议问题