Modify the size of the Zxing scanner (Android)

4,787 views
Skip to first unread message

Alejandro

unread,
Dec 23, 2011, 6:58:44 AM12/23/11
to zxing
Hi everybody,

I'm trying to develop a custom QR scanner using Zxing. I would like to
reduce the camera area, because I would like to put some buttons and
photos around the camera.

I've tried using IntentIntegrator and IntentResult and works fine but
I' m not able to change the size of the scanner.Neither using the
sample of AndroidTest.So...I'm thinking to use the Zxing project and
modify the size in the Camera class.Is it right?Which is the best
solution for change the size?

Best Regards,

Alejandro

Alejandro

unread,
Dec 23, 2011, 8:55:25 AM12/23/11
to zxing
Thanks Sean,that works, but only reduce the scan area. I'm afraid I've
explained the wrong way, sorry!I want to reduce the area of the
display of the camera and then overlay a layout whith buttons and
ImageView.I want the camera view embedded into a layout.

Regards,

Alejandro.

On 23 dic, 13:49, Sean Owen <sro...@gmail.com> wrote:
> Use intent extras SCAN_WIDTH and SCAN_HEIGHT for this.

Sean Owen

unread,
Dec 23, 2011, 9:36:31 AM12/23/11
to zx...@googlegroups.com
For this you just need to write your own UI from scratch, you can't customize to this great extent from Intents. You don't need to, and should not, copy code in android/ -- just write your own UI using SurfaceView. Then you can refer to android/, and how it uses code in core/ for decoding, to hook up the scanning.

Alejandro

unread,
Dec 23, 2011, 1:38:27 PM12/23/11
to zxing
I wrote it!!But I'm not sure about how launch the scanner in my
camera view.I suppose I have to do more or less the same that in the
camera package of android client[1],isn't it?

[1] http://goo.gl/IB9NT

Regards,

Alejandro.

Sean Owen

unread,
Dec 23, 2011, 6:49:25 PM12/23/11
to zx...@googlegroups.com
You don't launch the Barcode Scanner app, in this model -- your app is the scanner, since it needs to use a customized version of the core scanning code.

Alejandro

unread,
Dec 27, 2011, 4:20:21 AM12/27/11
to zxing
Thanks Sean, I'm still pretty lost.

I don't know very well where I have to focus my attention. In the
source of the core? Only with the qrcode package,would be enough?It
seems lot of work for only overlay a layout over the scanner.

Sean Owen

unread,
Dec 23, 2011, 7:49:36 AM12/23/11
to zx...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages