# ZXing.Delphi ZXing Barcode Scanning Library for Delphi XE 7 to 12 Athens.
ZXing.Delphi is a native Object Pascal library that is based on the well known open source Barcode Library: ZXing (Zebra Crossing). This port is based on .Net Redth port of ZXing and the Java one. This is I think the first native FireMonkey barcode lib. It is aimed at all of the FireMonkey mobile platforms and, starting from v3.1, it fully supports also Windows VCL applications (no dependencies on FMX.Graphics unit).
With this library you can scan with native speed without the use of linking in external libraries and avoid compatibility issues and dependencies. It is fast.
Its compatible with in Delphi XE7 - 11 Alexandria and tested with IOS 8.x - 15.x, Android 32/64, Windows 32/64 and OSX. The goal of ZXing.Delphi is to make scanning barcodes effortless, painless, fast and build within your FireMonkey or native Windows (VCL or Firemonkey) applications.
Just include the source files and add it in your existing projects and build the ZXing.Delphi source within your projects.
The standard camera component is, I think too slow for Android and IOS. You need to find a third party product or cook your own for a smooth experience. From Delphi 11 the standard camera component seems much improved.
1D product | 1D industrial | 2D |
---|---|---|
UPC-A | Code 39 | QR Code |
UPC-E | Code 93 | Data Matrix (Center images only) |
EAN-8 | Code 128 | |
EAN-13 | ITF |
v3.9.13 QR code: Fixed compute dimensions and more accurate results of sizeOfBlackWhiteBlackRunBothWays if outside of image. Replaced integer division with floating point division (Thanks ImperatorZurg).
v3.9.12 Fixed a bug in Bresenham's line algorithm
v3.9.11 Usage of FRAMEWORK_FMX and FRAMEWORK_VCL. See 'Usage' below.
v3.9.8 Fixes datamatrix https://github.com/Spelt/ZXing.Delphi/issues/162 and QR QRCode read error when contains when has char 10 https://github.com/Spelt/ZXing.Delphi/issues/163, pull requests with code optimization from EguitarRed and Rene Pastoors.
v3.9.7 updated fix for compatibility: https://github.com/Spelt/ZXing.Delphi/issues/143
v3.9.6
v3.9.5
v3.9.4
v3.9.3
v3.9.2
v3.9.0
v3.8.3
v3.8.1
v3.8
v3.7
v3.6
v3.5
v3.4
v3.3.1 Date: 2017/01/08 (Thanks for Nano103)
v3.3 Date: 2016/12/10 (Thanks for Nano103 for adding Code 39)
v3.2 Date: 2016/11/27
v3.1 Date: 2016/06/28 (Super many thanks to: Carlo Sirna)
v3.0 Date: 2016/04/28 (Great many thanks to: Kai Gossens and Raphael Büchler)
v2.4 Date: 2016/04/06
v2.3 Date: 2016/02/27
v2.2 Date: 2016/02/21
v2.1 Date: 2016/01/29
v2.0 Date: 2015/11/30
v1.1 Date: 2015/7/11
v1.0
Although it works extremely well, we still miss a few barcodes.For me there is no immediate need yet for me to implement more types but I like to add all of them! For that I need your help!
The base classes are already implemented so if you need to have another Barcode like Code39 (already done :-) ) you can see the C# source here: https://github.com/Redth/ZXing.Net.Mobile/blob/master/src/ZXing.Net/oned/Code39Reader.cs and convert it to Pascal. It's pretty easy (or just ask and I convert the raw classes for you).
If you want to help: Let us/me know which barcode you planning to implement. There is no point in converting barcodes multiple times :-)
If you use a Delphi older then 11.1 then you NEED to set a compiler Define in your 'project options->Delphi compiler->Conditional defines'. Set this in your target platforms or All platforms. See demo applications.
The simplest example of using ZXing.Delphi looks something like this:
Include all the files in your project or use search path like included test application
FScanManager := TScanManager.Create(TBarcodeFormat.CODE_128, nil);
FReadResult := FScanManager.Scan(scanBitmap);
Of course the real world is not that simple. To leave your app responsive while scanning you need to run things in parallel. I created a test app to show you how just to do that. Its included. It makes use of the new Firemonkey parallel lib. In the testApp the resolution of the camera is set to medium (FMX.Media.TVideoCaptureQuality.MediumQuality) on my iPhone 6. This is only possible since XE8 and equivalent Appmethod. Its also good to mention that how higher the resolution the more time it takes to scan a bitmap. Some scaling could probably work too.
Andrea Magni has a very nice blog post about an Android ZXing example from a training excerise of his. You can find it here.
ZXing.Delphi is a project that I've put together with the work of others. So naturally, I'd like to thank everyone who's helped out in any way. Those of you I know have helped I'm listing here, but anyone else that was involved, please let me know!
ZXing.Delphi is released under the Apache 2.0 license. ZXing.Delphi can be found here:https://github.com/Spelt/ZXing.Delphi A copy of the Apache 2.0 license can be found here: http://www.apache.org/licenses/LICENSE-2.0
ZXing is released under the Apache 2.0 license. ZXing can be found here: http://code.google.com/p/zxing/ A copy of the Apache 2.0 license can be found here: http://www.apache.org/licenses/LICENSE-2.0
ZXing.Net is released under the Apache 2.0 license. ZXing.Net can be found here: http://code.google.com/p/zxing/ A copy of the Apache 2.0 license can be found here: http://www.apache.org/licenses/LICENSE-2.0