ZXingObjC
=========
ZXingObjC is a full Objective-C port of [ZXing](https://github.com/zxing/zxing) ("Zebra Crossing"), a Java barcode image processing library. It is designed to be used on both iOS devices and in Mac applications.
The following barcodes are currently supported for both encoding and decoding:
* UPC-A and UPC-E
* EAN-8 and EAN-13
* Code 39
* Code 93
* Code 128
* ITF
* Codabar
* RSS-14 (all variants)
* QR Code
* Data Matrix
* Aztec ('beta' quality)
* PDF 417 ('alpha' quality)
ZXingObjC currently has feature parity with ZXing version 3.0.
## Requirements
ZXingObjC requires Xcode 5, targeting either iOS 6.0 and above, or Mac OS X 10.8 Mountain Lion and above.
## Usage
Encoding:
```objc
NSError *error = nil;
ZXMultiFormatWriter *writer = [ZXMultiFormatWriter writer];
ZXBitMatrix* result = [writer encode:@"A string to encode"
format:kBarcodeFormatQRCode
width:500
height:500
error:&error];
if (result) {
CGImageRef image = [[ZXImage imageWithMatrix:result] cgimage];
// This CGImageRef image can be placed in a UIImage, NSImage, or written to a file.
} else {
NSString *errorMessage = [error localizedDescription];
}
```
Decoding:
```objc
CGImageRef imageToDecode; // Given a CGImage in which we are looking for barcodes
ZXLuminanceSource *source = [[[ZXCGImageLuminanceSource alloc] initWithCGImage:imageToDecode] autorelease];
ZXBinaryBitmap *bitmap = [ZXBinaryBitmap binaryBitmapWithBinarizer:[ZXHybridBinarizer binarizerWithSource:source]];
NSError *error = nil;
// There are a number of hints we can give to the reader, including
// possible formats, allowed lengths, and the string encoding.
ZXDecodeHints *hints = [ZXDecodeHints hints];
ZXMultiFormatReader *reader = [ZXMultiFormatReader reader];
ZXResult *result = [reader decode:bitmap
hints:hints
error:&error];
if (result) {
// The coded result as a string. The raw data can be accessed with
// result.rawBytes and result.length.
NSString *contents = result.text;
// The barcode format, such as a QR code or UPC-A
ZXBarcodeFormat format = result.barcodeFormat;
} else {
// Use error to determine why we didn't get a result, such as a barcode
// not being found, an invalid checksum, or a format inconsistency.
}
```
## Installation
The recommended way to install ZXingObjC is with [CocoaPods](http://cocoapods.org), a dependency mananger for Objective-C projects. After installing CocoaPods just add ZXingObjC to your Podfile:
```ruby
platform :ios, '7.0'
pod 'ZXingObjC', '~> 3.0'
```
## Examples
ZXingObjC includes several example applications found in "examples" folder:
* BarcodeScanner - An iOS application that captures video from the camera, scans for barcodes and displays results on screen.
* BarcodeScannerOSX - An OS X application that captures video from the camera, scans for barcodes and displays results on screen.
* QrCodeTest - A basic QR code generator that accepts input, encodes it as a QR code, and displays it on screen.
## License
ZXingObjC is available under the [Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html).
没有合适的资源?快使用搜索试试~ 我知道了~
ZXingObjC库 二维码相册扫描 ObjectiveC版本
共514个文件
h:242个
m:228个
xcscheme:7个
5星 · 超过95%的资源 需积分: 10 85 下载量 53 浏览量
2015-05-12
11:17:47
上传
评论 1
收藏 1013KB ZIP 举报
温馨提示
ZXingObjC库 二维码相册扫描 ObjectiveC版本 已应用项目上。注意头文件导入 和 真机编译,不然xcode有个bug不长生.a档案。
资源推荐
资源详情
资源评论
收起资源包目录
ZXingObjC库 二维码相册扫描 ObjectiveC版本 (514个子文件)
AUTHORS 2KB
AUTHORS-ZXingObjC 455B
COPYING 11KB
.DS_Store 6KB
.gitattributes 22B
.gitignore 251B
ZXUPCEANReader.h 5KB
ZXBitMatrix.h 4KB
ZXQRCodeMatrixUtil.h 4KB
ZXGridSampler.h 4KB
ZXAddressBookParsedResult.h 4KB
ZXLuminanceSource.h 4KB
ZXQRCodeEncoder.h 4KB
ZXBitArray.h 4KB
ZXBinaryBitmap.h 3KB
ZXEncodeHints.h 3KB
ZXDataMatrixHighLevelEncoder.h 3KB
ZXBinarizer.h 3KB
ZXQRCodeVersion.h 3KB
ZXDecodeHints.h 3KB
ZXExpandedProductParsedResult.h 3KB
ZXResultMetadataType.h 3KB
ZXQRCodeFinderPatternFinder.h 3KB
ZXQRCodeDetector.h 3KB
ZXDataMatrixSymbolInfo.h 3KB
ZXingObjCOneD.h 3KB
ZXGenericGF.h 3KB
ZXResult.h 3KB
ZXDataMatrixVersion.h 2KB
ZXQRCodeBitMatrixParser.h 2KB
ZXReader.h 2KB
ZXResultParser.h 2KB
ZXQRCodeAlignmentPatternFinder.h 2KB
ZXCalendarParsedResult.h 2KB
ZXingObjCCore.h 2KB
ZXCapture.h 2KB
ZXGenericGFPoly.h 2KB
ZXQRCodeMode.h 2KB
ZXCode39Reader.h 2KB
ZXErrors.h 2KB
ZXQRCodeMaskUtil.h 2KB
ZXAztecState.h 2KB
ZXBitSource.h 2KB
ZXPDF417.h 2KB
ZXQRCodeDecoder.h 2KB
ZXWhiteRectangleDetector.h 2KB
ZXReedSolomonDecoder.h 2KB
ZXDecoderResult.h 2KB
ZXQRCodeDataMask.h 2KB
ZXCGImageLuminanceSource.h 2KB
ZXQRCodeDataBlock.h 2KB
ZXQRCodeFinderPattern.h 2KB
ZXPDF417ErrorCorrection.h 2KB
ZXPerspectiveTransform.h 2KB
ZXDataMatrixDecoder.h 2KB
ZXHybridBinarizer.h 2KB
ZXBarcodeFormat.h 2KB
ZXDataMatrixEncoderContext.h 2KB
ZXAbstractRSSReader.h 2KB
ZXDataMatrixDataBlock.h 2KB
ZXVINParsedResult.h 2KB
ZXPDF417BoundingBox.h 2KB
ZXWriter.h 2KB
ZXAztecHighLevelEncoder.h 2KB
ZXQRCodeErrorCorrectionLevel.h 2KB
ZXPlanarYUVLuminanceSource.h 2KB
ZXPDF417BarcodeRow.h 2KB
ZXAztecEncoder.h 2KB
ZXMonochromeRectangleDetector.h 2KB
ZXParsedResult.h 1KB
ZXEmailAddressParsedResult.h 1KB
ZXGlobalHistogramBinarizer.h 1KB
ZXITFReader.h 1KB
ZXQRCodeAlignmentPattern.h 1KB
ZXMultiFormatReader.h 1KB
ZXWifiParsedResult.h 1KB
ZXQRCodeFormatInformation.h 1KB
ZXURIParsedResult.h 1KB
ZXDataMatrixDefaultPlacement.h 1KB
ZXGeoParsedResult.h 1KB
ZXPDF417Detector.h 1KB
ZXSMSParsedResult.h 1KB
ZXGenericMultipleBarcodeReader.h 1KB
ZXAztecDetector.h 1KB
ZXResultPoint.h 1KB
ZXCharacterSetECI.h 1KB
ZXPDF417HighLevelEncoder.h 1KB
ZXSMSMMSResultParser.h 1KB
ZXDataMatrixBitMatrixParser.h 1KB
ZXPDF417Common.h 1KB
ZXOneDReader.h 1KB
ZXMultiFinderPatternFinder.h 1KB
ZXQRCodeDecodedBitStreamParser.h 1KB
ZXPDF417BarcodeMatrix.h 1KB
ZXEmailDoCoMoResultParser.h 1KB
ZXPDF417DetectionResult.h 1KB
ZXCode128Reader.h 1KB
ZXModulusGF.h 1KB
ZXRSSExpandedPair.h 1KB
ZXModulusPoly.h 1KB
共 514 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
- GCZtian2018-07-13很不错,值得下载
- dear风会停息2015-10-08挺实用的例子,用的还好、
- 摩尼莎2016-01-13挺实用的例子,用的还好
phego
- 粉丝: 0
- 资源: 4
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功