ios-detailed how to use ZBARSDK Integrated scan QR code/Barcode, point me!

Source: Internet
Author: User

1. PrefaceCurrently in the mainstream market app, QR code/Barcode integration is mainly divided into two forms to integrate: a. One is to call the phone camera and open the system camera full screen to shoot B. One is to customize the frame of the camera view, control and add the relevant code guide to me today I'm going to use ZBARSDK to make appeals. Two main ways of integration, sharing learning with everyone2. First step import zbarsdkYou can download the ZBARSDK from GitHub, import the project, and import the relevant ios.framework3. Integrated scan QR code/Barcode3.1. Call the phone camera and open the system camera full screen to shoot

Implementation: 1. A button "Sweep Me"--2. Click to open the System camera--3. Go to full screen shooting, take the QR code--4. Identify successful auto-off camera

3.1.1. Import #import "ZBarSDK.h" and implement the relevant protocol

Call system camera full screen shot, using the protocol is <ZBARREADERDELEGATE>, custom camera window using <ZBarReaderViewDelegate>

3.1.2. Implement details in the click Method of the button "Sweep Me"
    Initialize the camera controller    zbarreaderviewcontroller *reader = [Zbarreaderviewcontroller new];    Set proxy    reader.readerdelegate = self;    Basic adaptation    reader.supportedorientationsmask = Zbarorientationmaskall;       QR Code/Barcode Recognition Settings    Zbarimagescanner *scanner = Reader.scanner;       [Scanner setsymbology:zbar_i25                   config:zbar_cfg_enable                       to:0];    Eject system camera, full screen shooting    [self presentmodalviewcontroller:reader                           animated:yes];
3.1.3. Implementing Proxy Methods

3.2. Customize the frame of the camera view, control and add the relevant code guide3.2.1. Import #import "ZBarSDK.h" and implement the relevant protocol Call system camera full screen shot, using the protocol is &LT;ZBARREADERDELEGATE&GT;, custom camera window using <ZBarReaderViewDelegate>3.2.2. Implement details in the click Method of the button "Sweep Me"
     Initialize Camera window    zbarreaderview *readview = [Zbarreaderview new];    Custom size    Readview.frame = CGRectMake (+, +, +);    Custom Add related instructions ..... Play the imaginations of their respective apps/    /omit to beautify the 10000 lines of code    here ..... .........    ........... Good to get to the point--and then set the agent    readview.readerdelegate = self;       Add its camera capture view to the view you want to display    [Self.viewaddSubview:readview];          QR Code/Barcode Recognition Settings   Zbarimagescanner *scanner = Readview.scanner;      [Scanner setsymbology:zbar_i25                   config:zbar_cfg_enable                       to:0];   Start, must start after the phone camera shot the instant image dish can be displayed on Readview   [Readview start];
3.2.3. Implementing Proxy Methods

Clear Saup
Source: http://www.cnblogs.com/qingche/
This article is copyright to the author and the blog Park is shared, welcome reprint, but must retain this paragraph statement, and in the article page obvious location to give the original text connection.

ios-detailed how to use ZBARSDK Integrated scan QR code/Barcode, point me!

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.