Before in the project used zxing generated two-dimensional code, recently another project also need to use two-dimensional code, so re-learning to use zxing to generate two-dimensional codeThe next step is to prepare the work, because I was developed with vs2013, so I chose the. net4.5 version of the Zxing.dll. In addition, a ready-to-embed image is shown in the following code:1 usingSystem;2 usingSystem.Co
1. First of all now zxing Lib2. Integrated zxing in Android studio. public void Scan (view view) { Startactivityforresult (new Intent (Mainactivity.this, Captureactivity.class), 0); }The above is an open sweep. Two-dimensional code generation can go to http://cli.im/3. Create two-dimensional code public void make (view view) { String input = Minput.gettext (). toString (); if (
When we are in the zxing framework to scan the QR code, we will find that now the mobile phone with the resolution of the addition. The scanning box will be smaller, the 1920*1280 and 1280*720 are relatively normal. But Samsung's several mobile phone note4,5. S6, such as several mobile phone resolution up to 2560*1440, even some phones up to 3660 of the bar can't remember.When these phones scan, pop-up scan activity Intermediate surfaceview Scan form
Use zxing batch in the designated position of a good standing card background map, the specified text content (link address, text, etc.) generated two-dimensional code and placed in the position, and finally add the sign number.
Steps:
1). Do the background map, the following figure:
2. Generate two-dimensional code BufferedImage objects. The code is as follows:
/** * * @Title: Tobufferedimage * @Description: Convert text into two-dimensiona
With the arrival of micro-letter, two-dimensional code more and more hot, everywhere can see two-dimensional code, such as the mall inside, KFC, restaurants and so on, for two-dimensional code scanning we are using Google's Open source framework zxing, we can go to http://code.google.com/p/zxing/ Download source and jar package, before my project two-dimensional code scanning function only to achieve the sc
Modified based on this source code.
Http://blog.csdn.net/ryantang03/article/details/7831826
In addition to the QR code image generation function that he added, the package is saved.
The sound effect after scanning is removed, saving a sound file.
With the flashlight function removed, scan the QR code at night to go to bed quickly. Saves a class.
Scanning timeout is removed, saving two classes.
Removed the title bar of the scan interface, saving an image file.
For ease of use,
public static Bitmap Create2dcode (String str) throws Writerexception {Generate a two-dimensional matrix, specify the size of the encoding, do not generate a picture and then zoom, which will blur leading to recognition failurehashtablehints.put (Encodehinttype.character_set, "UTF-8");Bitmatrix matrix = new Multiformatwriter (). Encode (Str,barcodeformat.qr_code, 300, 300,hints);int width = matrix.getwidth ();int height = matrix.getheight ();The two-dimensional matrix is converted into a one-dim
Zxing is a QR code scanning project provided by GoogleThe default sweep area of the demo itself is the largest only 360*480 need to pull a long distance to scan the entire QR codeSo we need to adjust the size of the map ourselves.Make adjustments in the Cameramanager.java classThe default size is the following 4 parameters private static final int min_frame_width = 240;// private static final int min_frame_height = 240;// privat e static final int
(Options, Format, bitmap); Break Case BarcodeFormat.PLESSEY:var Plessey_writer = new Zxing.barcodewriter (); Plessey_writer.format = Barcodeformat.plessey; Plessey_writer.options = Options; Bitmap = Plessey_writer.write (TbxBarcodeValue.Text.Trim ()); Barcodeoptionschanged?. Invoke (Options, Format, bitmap); Break Case Ba
Custom Scan interface Capturefragment.setanalyzecallback (analyzecallback); LOG.D ("Bug", "OnCreate: "+3); The r.id.fl_zxing_container corresponds to the Fragment Getsupportfragmentmanager () in the Setcontentview layout. BeginTransaction (). Replac E (R.id.mycamera, capturefragment). commit (); Replace Setcontenview settings in the layout with ID Mycamera} codeutils.analyzecallback analyzecallback = new Codeutils.analyzecallback () {@Override public void onanalyzesuccess (Bitmap mbitmap, Str
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.