Zxing - Change the look of the camera -90 degrees

First of all, I would like to refer to this Issue on google groups.

My problem is that I want the landscape-oriented application to work in portrait mode. The way to get the application in portrait mode is not a problem, but when you show the application in portrait mode, my problem arises.

When a barcode scanner launches op, its camera view (default) is at an angle of +90 degrees. When viewing the application in portrait mode, the barcode scanner (of course) is still at an angle of +90 degrees.

A hack is displayed on the mentioned problem page to work around the problem, but this does not work on most devices. This also does not work on my target devices.

I would like to hear if some of you have a job or find a place in the source where you can “cancel” a 90-degree click?

The useful answer will be very approximated: D Unfortunately, I can’t make progress in the project before it is allowed. It is required to work in portrait mode;)

Thanks in advance...)

+7
source share
1 answer

I implemented this in a private assembly. This is complicated and I cannot share the details. Key steps are:

  • Call Camera.setDisplayOrientation() to counter rotation; see Android javadoc for a discussion of this.
  • Make sure Camera.Parameters.setPreviewSize() is being called correctly; preview sizes are displayed in the landscape, but must be set in the portrait.
  • (And guess what - the default orientation of phones is considered portrait, but tablets are considered landscape! Make sure you take that into account as well.)
  • Finally, the preview data is always in landscape mode. You need to rotate it yourself to read it on the right side or otherwise explain it.
+4
source

All Articles