How to display Capture Activity in Portrait mode?

1,542 views
Skip to first unread message

Umar

unread,
Feb 6, 2012, 5:02:37 AM2/6/12
to zxing
dear experts,

i have changed "android:screenOrientation" in menifest file to display
this activity of scanning in portrait mode as given below but it is
not showing scanning rectangle in portrait mode.

any one guide what else i need to do to show that scanning rectangle
in portrait mode?

<activity
android:name="com.google.zxing.client.android.CaptureActivity"
android:screenOrientation="portrait"
android:clearTaskOnLaunch="true"
android:stateNotNeeded="true"
android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/
Theme.NoTitleBar.Fullscreen"
android:windowSoftInputMode="stateAlwaysHidden"
>

any help would be appreciated

Sean Owen

unread,
Feb 6, 2012, 6:08:00 AM2/6/12
to zx...@googlegroups.com
It is not this simple, as you need to change several more things to get it right in portrait mode:
  • Account for device and camera orientation, both of which can be 0,90,180,270
  • (and account for front cameras for which some of these values are flipped)
  • Set the preview display's rotation
  • Rotate the preview data correctly before analyzing it
  • Choose preview size correctly, accounting for the fact it may be given in landscape
  • Change the UI elements to display reasonably in portrait
It took me probably a week total of solid work to get this completely right, and the result is here: https://market.android.com/details?id=com.srowen.bs.android
While I can't share the code now, I can list the steps above, and may be able to put this into the open source project later.

Umar .

unread,
Feb 6, 2012, 6:12:39 AM2/6/12
to zx...@googlegroups.com
in, simple words portrait mode is not available in this library yet?

Sean Owen

unread,
Feb 6, 2012, 6:22:06 AM2/6/12
to zx...@googlegroups.com
The Android app is landscape-only, yes.

Fabio A. Sanchez Mejia

unread,
May 11, 2015, 2:23:19 PM5/11/15
to zx...@googlegroups.com
El lunes, 6 de febrero de 2012, 6:22:06 (UTC-5), Sean Owen escribió:
> The Android app is landscape-only, yes.

Hi Sean.

I'm trying to edit the screen activity capture QR code using ZXing Library, how to do this? What should edit to achieve something like this: http://i.stack.imgur.com/8OUau.png and modify default screen on ZXing ?
Reply all
Reply to author
Forward
0 new messages