After reading vurtex examples, I modified the code based on the [Android instance] QR code scan-Simplified zxing Android source code (Appendix: Chinese supported ).
1. added the method of nesting code into your own project and passing the value (Beginner, if there is a better way to tell me, thank you first)
2. The code scanning interface is processed. (Some existing software is initially implemented. As for the long image, no one will talk about it)
// Draw code with four corners
Paint. setcolor (framecolor); canvas. drawrect (15 + frame. left, 15 + frame. top, 15 + (linewidht + frame. left), 15 + (50 + frame. top), paint); canvas. drawrect (15 + frame. left, 15 + frame. top, 15 + (50 + frame. left), 15 + (linewidht + frame. top), paint); canvas. drawrect (-15 + (0-linewidht) + frame. right), 15 + frames. top,-15 + (1 + frame. right), 15 + (50 + frame. top), paint); canvas. drawrect (-15 + (-50 + frame. right), 15 + frames. top,-15 + frame. right, 15 + (linewidht + frame. top), paint); canvas. drawrect (15 + frame. left,-15 + (-49 + frame. bottom), 15 + (linewidht + frame. left),-15 + (1 + frame. bottom), paint); canvas. drawrect (15 + frame. left,-15 + (0-linewidht) + frame. bottom), 15 + (50 + frame. left),-15 + (1 + frame. bottom), paint); canvas. drawrect (-15 + (0-linewidht) + frame. right),-15 + (-49 + frame. bottom),-15 + (1 + frame. right),-15 + (1 + frame. bottom), paint); canvas. drawrect (-15 + (-50 + frame. right),-15 + (0-linewidht) + frame. bottom),-15 + frame. right,-15 + (linewidht-1) + frame. bottom), paint );
The linewidht variable controls the width of the four corners and displays the effect when set to 2.
Replace the two sentences defined in the vmiddle hmiddle variable in the viewfinderview class with a small cross coordinate.
canvas.drawRect(hmiddle - 20, vmiddle - 1, hmiddle + 20,vmiddle + 2, paint);canvas.drawRect(hmiddle - 1, vmiddle - 20, hmiddle + 2,vmiddle + 20, paint);
Code: http://www.eoeandroid.com/forum.php? MoD = viewthread & tid = 225832 & page = 1 & extra = # pid1997182
Paste some classic scanning Interfaces
References:
Getting started with Android: zxing learning notes
QR code scan-Simplified zxing Android source code (Appendix: Chinese supported)
Full Analysis of Android barcode recognition software development
Zxing to landscape screen recognition to landscape screen Recognition
Upload two hours ago
Download Attachment(689.77 KB) scan code