How to increase scanning area size in zxing

前端 未结 4 660
遥遥无期
遥遥无期 2020-12-06 14:16

Hii everyone currently iam working on scanning qr code from my app and i have used zxing library and it\'s working good and my problem is in my galaxy s4 mobile the scanni

4条回答
  •  独厮守ぢ
    2020-12-06 14:56

    public Rect getFramingRect() {
    if (framingRect == null) {
      if (camera == null) {
        return null;
      }
      Point screenResolution = configManager.getScreenResolution();
            int screenx = screenResolution.x;
            int screeny = screenResolution.y;
            int width, height, left, top;
            if (screenx > screeny) {
                width = (int) (screenx * 12.5 / 100);
                height = (int) (screeny * 25 / 100);
                left = (int) screenx * 83 / 100;
                top = (int) screeny * 75 / 100;
            } else {
                left = (int) (screenx * 12.5 / 100);
                top = (int) (screeny * 25 / 100);
                width = (int) screenx * 83 / 100;
                height = (int) screeny * 75 / 100;
            }
      framingRect = new Rect(left,top, width, height);
    
      Log.d(TAG, "Calculated framing rect: " + framingRect);
    }
    return framingRect;
    }
    

    Replace the above code in CameraManager.java file this worked for me try this out

提交回复
热议问题