Android Zxing changer d'orientation en mode portrait

Je suis en train de faire pivoter Zxing affichage après la lecture de quelques questions et messages sur la question.
Après avoir suivi les instructions, l'écran fait tourner, mais le rectangle de le scanner
n'est pas positionné comme il se doit (comme on peut le voir sur l'image ci-jointe).

C'est ce que j'ai fait:

  1. dans CameraConfigurationManager:

    camera.setDisplayOrientation(90);
  2. dans DecodeHandler.java

    byte[] rotatedData = new byte[data.length];
        for (int y = 0; y < height; y++) {
            for (int x = 0; x < width; x++)
                 rotatedData[x * height + height - y - 1] = data[x + y * width];
         }
    int tmp = width;         
    width = height;
    height = tmp;
  3. dans CameraManager.java:

    rect.left = rect.left * cameraResolution.y / screenResolution.x;
    rect.right = rect.right * cameraResolution.y / screenResolution.x;
    rect.top = rect.top * cameraResolution.x / screenResolution.y;
    rect.bottom = rect.bottom * cameraResolution.x / screenResolution.y;

Android Zxing changer d'orientation en mode portrait

InformationsquelleAutor Udi Idan | 2012-04-18