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 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
First to show you the effect of the picture:
The scan is the following one, and the two-dimensional code is generated using the Zxing library.
Because of the change of several classes, or last year's things are almost forgotten, so only on the code of this class, the main is to change the Captureactivity.java
Package com.zxing.activity;
Import java.io.IOException;
Import Java.util.Vector;
Import android.app.Activity;
Import android.content.
notes, Google zxing two-dimensional code, with data flow output to the page display
Two-dimensional code has been very popular, today practiced a bit, requirements are generated for the different parameters of the address link two-dimensional code, and displayed on the page, if the use of generated pictures to save the local return to the relative path, will produce a heap of garbage picture files, but also to remove the late is really trouble, think
A while ago, I was working on a seller's coupon function and needed a bar code. So I sorted out the information again.
1. What is a bar code?
Baidu encyclopedia definition: barcode is a graphic identifier used to express a set of information by sorting multiple black bars and white spaces with different widths according to certain encoding rules. A common bar code is a parallel line of a black stripe (abbreviated as a bar) and a white stripe (blan
Original link: http://hi.baidu.com/282518588/item/d026413db0fac6b2124b147d#713670-tqq-1-62579-73c8c094f3d19c62454c09579207fe3e
Barcode Generation uses a lot of barbecue and barcode4j. I first use the barbecue, bar code can be displayed, but the following corresponding numbers can not be shown, of course, manually plus to go, but that is not a picture inside, typesetting is not very good-looking. So I tried a barcode4j, the effect is very good, so put
Bcodebitmap = encoder. Encode (Qrdata. ToString ());
Bcodebitmap.save (@ "E:\HelloWorld.png", imageformat.png);
Bcodebitmap.dispose ();
}
3): Through Spire.barcode (Spire.BarCode.dll) to achieve
1.1): First download the corresponding Third-party components through the VS2015 NuGet, as shown in the following figure:
1.2): The concrete generation of two-dimensional code method is as follows
private void Generateqrbyspire ()
{
barcodesettings bs = new barcodesettings ()
{
Data = '
1. What is a barcode?
Baidu Encyclopedia definition: bar code (barcode) is the width of a number of black bars and blank, according to a certain coding rules, to express a set of information graphic identifier. A common barcode is a pattern of parallel lines of black strips (short strips) and white bars (short ones) that vary greatly in reflectivity. In daily l
Now there are 3 choices, hehe!
Today, with CorelDRAW to draw bar code, but also good! It is more convenient to play the same bar code! The location of the determination also can be
Codesoft 6.0 Professional label design printing software
Professional software can be accurate positioning, you can set the precise bar code wide, high, so that the use of arbitrary, more convenient!
"This I have installed, cracked registered 6.02 Enterprise Edition, the function is very powerful"
BarTender7.1
Product barcode (JBarcode ),
I have never used this before. Now I use JBarcode to generate the product barcode. Preparations before work:
Eclipse:Eclipse Java ee ide for Web Developers.Version: Helios Service Release 1Build id: 20100917-0705
Jar package:JBarcode-Recognition_Source-0.2.jarJbarcode-0.2.8.jarCommons-lang-2.6.jar
First understand the rules of EAN-13 code:
Then let's take a look at the arrange
Module : BarcodeBarcode Module Management Barcode scanning, provide common barcode (two-dimensional code and one-dimensional code) scanning recognition function, can call the device's camera to the barcode image scanning for data input. Barcode Code Management Objects can be obtained through Plus.barcode.Use the scene
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.