JDK used is 1.9, you need to configure the following line. */ //system.setproperty ("Java.specification.version", "1.9");Result result =NULL; Try{File File=NewFile (FilePath); BufferedImage BufferedImage=imageio.read (file); Binarybitmap Bitmap=NewBinarybitmap (NewHybridbinarizer (NewBufferedimageluminancesource (bufferedimage)); HashMap hints=NewHashmap(); Hints.put (Encodehinttype.character_set, Chartset); Result=NewMultiformatreader (). Decode (bitmap, hints); } Catch(notfo
-legacy:2.0.1@aar '//convenience The library to launch the scanning and encoding activities. It automatically picks the best scanning library from the above two, depending on the//Android version and what is a
vailable. Compile ' com.journeyapps:zxing-android-integration:2.0.1@aar '//Version 3.0.x of zxing core contains some code is n
OT compatible on Android 2.2 and earlier.
This mostly affects encoding and but you should test if you are to suppor
1, download the zxing on the http://zxingnet.codeplex.com/site. NET third-party libraries2, the download after decompression can see there are different. NET version of the DLL file, referencing the correct DLL in your project3. Then reference the System.Drawing assembly in your project4. In the window where you need to generate the QR code, add the code// Reclaiming Objects [DllImport ("gdi32")] Static extern int DeleteObject (IntPtr o); /** *
() : createTable(); $(element).appendTo(this); });
After modification, you do not need to specify the render parameter. If canvas is not supported, table is used. the disadvantage of using canvas is that it cannot be displayed during webpage printing... there seems to be a solution to this problem. I didn't find it. I used the table directly. However, printing still seems problematic. Js has a problem, so zxing can only be used
perfect solution to solve Android using zxing scan QR code changed to vertical screen, after the preview screen appeared stretched, distorted situation
First step: Findcom.zxing.cameraUnder the bagCameraConfigurationManager.javaIn the filevoid initFromCameraParameters(Camera camera)MethodStep two: InLog.d(TAG, "Screen resolution: " + screenResolution);Then add the following codenew Point();screenResolutionForCamera.x = screenResolution.x;screenRes
Paste the code First:#1.Install Tesseract-ocr*.exe from http://jaist.dl.sourceforge.net/project/tesseract-ocr-alt/ Tesseract-ocr-setup-3.02.02.exe#2.Install Pillow as "pip Install form *.WHL"#3.Install pytesseract as "pip Install form *.WHL"ImportOs.pathImportpytesseract fromPILImportImage fromJpypeImport*##################################################### TESSERACE-OCR ########################################## ###########image = Image.open (r "D:\Project\AI\1.MachineLearning\A.Tensorflow\2.P
Zxing Official code Many, looks very laborious, this demo only extracts the useful part, realizes the camera preview decoding, parses the local QR code, produces the QR code three function.The simplified structure is as follows:Nonsense less say directly on the code:Basedecodehandler:Package Com.song.zxing.decode;import Android.graphics.bitmap;import Android.os.bundle;import Com.google.zxing.barcodeformat;import Com.google.zxing.decodehinttype;import
Android Zxing QR code scanning image stretching,
In this project, the QR code scanning is integrated with zxing, and the image on the scanning interface is obviously stretched and deformed.
Based on past experience, this problem is generally caused by misplacement of x and Y axes. The problem of x and Y axes can be solved.
Because of this problem, many people have encountered it before and shared it online,
After Android uses Zxing to scan the QR code and change it to a portrait screen, the preview screen is stretched and distorted.
Perfect solution: After Android uses Zxing to scan the QR code and changes it to a portrait screen, the preview screen is stretched and distorted.
Step 1: Find
com.zxing.cameraPackage
CameraConfigurationManager.javaFile
void initFromCameraParameters(Camera camera)Method
Step 2:
Zxing portrait screen switch android
The ZxingDemo downloaded on google is in the landscape status.
In Androidmanifest. xml, I simply change Activity to a vertical screen. android: screenOrientation = "portrait"
Although the screen is positive, the shooting screen displayed on the screen is still horizontal.
I checked some online materials and manually debugged them.
Here is a summary
Steps:
1) In AndroidManifest. xml, modify the screenOrientation o
IOS QR code scan through ZBar ZXing and other third-party libraries, zbarzxing
There are many open-source libraries for scanning QR codes, such as ZBar and ZXing.
How to Use ZBar:
Download ZBar SDK
Address https://github.com/bmorton/ZBarSDK
ZBarSDK is an open source SDK that implements the identification and reading of various bar codes, including EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved
I want to use the Android mobile phone to scan QR code and bar code. I went online to gogole and found an open-source library zxing, which can fully implement the functions I needed.
After checking out SVN, it's really big (Android version) and has many functions.
The functions I want to achieve in my project are scanning and decoding QR codes and bar codes.
Therefore, zxing is simplified.
Project Struc
Copy and use it directly.
using UnityEngine;using System.Collections;using System;using Vuforia;using System.Threading;using ZXing;using ZXing.QrCode;using ZXing.Common;using UnityEngine.SceneManagement;public class CameraImageAccess : MonoBehaviour{ private Image.PIXEL_FORMAT m_PixelFormat = Image.PIXEL_FORMAT.GRAYSCALE; private bool m_RegisteredFormat = false; public bool reading; public string QRMessage; public UnityEngine.UI.Text la
The recent project used to the generation and identification of two-dimensional code, before touching this piece, and then on the Internet search, found that there are many resources in this area, in particular, Google zxing to the two-dimensional code package, the implementation has been good, can directly take over the reference, downloaded their source code, only made a few changes, It is in the demo to add a long-press recognition function, althou
The main implementation of the Webwiew Onlongclick () method, usingHittestresult htr = Gethittestresult (); // get the clicked contentJudging whether the click is a picture, its main code is: @Overridepublic boolean Onlongclick (View v) {//Long press Event Listener (Note: You need to implement the Longclickcallback interface and pass in the object) final Hittestresult htr = Gethittestresult ();//Gets the clicked content if (htr.gettype () = = hittestresult.image_type| | htr.gettype () = = hi
First of all, we need to import the zxing jar file, then copy the required resource files and put in the resource files that we need to add, and copy out the necessary related files of the source code. Make certain changes to the layout file, and then modify the code in Captureactivity and Viewfinderview. Here are the and source code:Source Address:Http://www.androidym.com/thread-54459-1-1.htmlImplementation of Android custom
It has to be said that the application of QR code is more and more extensive. Don't say much nonsense.The jar used here is not many, only use the zxing package inside the Core.jar package can, we download,If it is Baidu Cloud disk, the address is: Http://pan.baidu.com/s/1eQeWFaqAfter a lot of blog resources will be updated to this address, we try to transfer the resources of their own disk, to prevent the link one day suddenly hang.Instance:Genqrcode
Related reading:
Android Development Framework's custom zxing two-dimensional code scanning interface and solving frame stretching problems
This project source address: please click here
Take a look at Zxing's project structure, I'll get it right here.
Look at the activity of the sweep code:
Package com.fanyafeng.barcode.activity;
Import android.content.Intent;
Import Android.graphics.Bitmap;
Import Android.net.Uri;
Import Android.os.Bund
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.