2

I'm using the zxing 2.1 version, I need to capture the qr code in portrait mode, I've set the displayOrientation to "90" in CameraConfigurationManager.

Modified Methods,

CameraConfigurationManager->initFromCameraParameters(Camera camera)
                           -> setDesiredCameraParameters(Camera camera, boolean safeMode)

But problem in setting the ViewFinder to match for portrait mode,can some one help me on how to do this..

Sam

Sam
  • 6,215
  • 9
  • 71
  • 90
  • Here's what you can do with zxing 2.1. http://stackoverflow.com/questions/16252791/how-to-show-zxing-camera-in-portrait-mode-on-android/16252917#16252917 – Roy Lee Apr 27 '13 at 16:36

2 Answers2

2

It's not quite that simple, since the orientation has to be set correctly as well, the UI orientation has to be set, and the UI has to be rewritten to have a landscape version. You also have to detect the camera's orientation, and account for the fact that it may be on the front vs back. It's about 5 things to get right rather than a one line change. Have a go at it, and ask specific questions about what you have tried in another SO question then.

Sean Owen
  • 66,182
  • 23
  • 141
  • 173
  • I'm not clear about your answer,if you can expand what you mean by "5 things to get right rather than a one line change" i found this link and tried it http://code.google.com/p/zxing/issues/detail?id=178#c46 but still the rectangle box is not in center for portrait mode, how do i position the rectangle box? – Sam Jan 31 '13 at 23:15
  • Yes. It doesn't work because there is more to change. Have you started by trying to implement other necessary changes like the ones discussed there? – Sean Owen Feb 01 '13 at 00:06
1

I found the following github project useful, https://github.com/pplante/zxing-android

It's using zxing 1.7 source as a base.

Have useful info in this link too http://code.google.com/p/zxing/issues/detail?id=178

Sam
  • 6,215
  • 9
  • 71
  • 90