Herdr UI
Herdr의 TUI가 뛰어나며, 창을 통해 추가되는 기능
Delphi VCL 및 FireMonkey용 ZXing 바코드 스캔 Pascal 라이브러리
ZXing Barcode Scanning object Pascal Library for Delphi VCL and Delphi Firemonkey
개발 도구Pascal · BatchfileGitHub @Spelt직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗ZXing.Delphi is a native Object Pascal library that is based on the well known open source Barcode Library: ZXing (Zebra Crossing). This port was based on .Net ZXing and the Java one. From v4 it is based of the C++ port which had lots of better and faster scan strategies. See features and highlights. It is aimed at all of the FireMonkey platforms and, starting from v3.1, it fully supports also Windows VCL applications.
With this library you can scan with native compiled speed without the use of linking in external libraries and avoid compatibility issues and dependencies. It is fast. Its compatible with Delphi 10.4 Sydney - 13.x Florence (for XE7 - 10.3 use v3.13.1) and tested with the latest IOS, Android 32/64, Windows 32/64 and OSX.
Just include the source files and add it in your existing projects and build the ZXing.Delphi source within your projects.
ZXing.Delphi 4.0 is by far the biggest step since the port began. The library grew from 10 symbologies to 52: Aztec, PDF417 and MicroPDF417, Micro QR and rMQR, MaxiCode, the GS1 DataBar family and GS1 Composite, DotCode and Han Xin, the stacked codes Codablock F, Code 16K and Code 49, and the postal barcodes from KIX to Intelligent Mail, several of which no other ZXing port reads at all.
The QR Code and Data Matrix detectors are ports of zxing-cpp, so perspective, curved and dot-peen codes that 3.x missed are read now, and an image pyramid catches the large and blurry ones. It is also much faster: the luminance conversion, binarizer and 1D readers were rewritten, and the readers run side by side in the tasks of a thread pool, so a frame is decoded on all cores. The API grew with it: one ScanAsync call scans a camera frame in the background and hands the result to the main thread.
It is also much faster then the previous version: on the same images 4.0 scans about five times faster than 3.x on a single core, while trying five times as many formats, and on large camera frames the readers decode side by side on all cores.
There is a new demo app that shows all of it: a scanner with tracked outlines and a settings screen, built with the standard FMX components only.
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:
Create the scan manager once and use it for all frames; it is not meant to be used by two threads at the same time. Hints are passed as a dictionary, which the scan manager frees:
var hints := TDictionary<TDecodeHintType, TObject>.Create;
hints.Add(TDecodeHintType.TRY_HARDER, nil); // slower, finds more (also rotated 1D codes)
hints.Add(TDecodeHintType.ENABLE_INVERSION, nil); // also light codes on a dark background
FScanManager := TScanManager.Create(TBarcodeFormat.Auto, hints);
For a camera, scan in the background and get the result in the main thread (the bitmap may be reused as soon as ScanAsync returns; a frame that arrives while a scan runs is skipped; Scanning tells whether a scan runs):
FScanManager.ScanAsync(frameBitmap,
procedure(r: TReadResult)
begin
if (r <> nil) then
try
lblResult.Text := r.Text;
finally
r.Free;
end;
end,
procedure(e: Exception)
begin
lblResult.Text := e.Message;
end);
All barcodes in an image, with the extra information of a result:
var list := FScanManager.ScanAll(scanBitmap); // a TObjectList: frees the results
try
for var r in list do
begin
Memo1.Lines.Add(r.SymbologyIdentifier + ' ' + r.Text);
// r.Position: the 4 corners in the image, r.Orientation: the rotation in degrees
if r.IsGS1 then
Memo1.Lines.Add(r.GS1HRI); // e.g. (01)05909990329717(17)270430(10)NE76571
end;
finally
list.Free;
end;
A QR Code or Data Matrix that was found but could not be read:
FScanManager.ReturnErrors := true;
var r := FScanManager.Scan(scanBitmap);
if (r <> nil) and (r.Error <> '') then
// r.Text is empty, r.Position is where the code is: e.g. ask to hold the camera still or closer
lblStatus.Text := 'Barcode found, but not readable (' + r.Error + ')';
See the Demo app for a real world example.
Andrea Magni has a blog post about ScannerMApp, a QR code and barcode scanner app built with Delphi, ZXing.Delphi and TFrameStand: ScannerMApp, nine years later: ZXing.Delphi 4, TFrameStand and Android intents covers the move to ZXing.Delphi 4, with background decoding (ScanAsync). The original 2017 post is still online.
All formats are read with TBarcodeFormat.Auto, except the ones marked "only when asked for" (choose them as TScanManager format or in the hint POSSIBLE_FORMATS).
| Format | TBarcodeFormat | Also | Notes |
|---|---|---|---|
| QR Code | QR_CODE | Model 1 and 2, ECI, GS1, Structured Append | perspective and not flat symbols |
| Micro QR Code | MICRO_QR_CODE | M1 to M4 | |
| rMQR Code | RMQR_CODE | ECI, GS1 | rectangular Micro QR Code |
| Data Matrix | DATA_MATRIX | square, rectangular and DMRE sizes, ECI, GS1, mirrored | dot-peen codes with TRY_HARDER |
| Aztec | AZTEC | compact and full range, Aztec Runes, ECI, GS1, Structured Append, mirrored | |
| PDF417 | PDF_417 | Compact PDF417, Macro PDF417, ECI | |
| MicroPDF417 | MICRO_PDF417 | Macro PDF417, ECI | |
| MaxiCode | MAXICODE | modes 2 to 6, ECI, Structured Append | with detector: anywhere in the image, rotated and in perspective (camera) |
| DotCode | DOTCODE | all code sets, binary, macros 05/06/12, ECI, GS1 (]J1) | only when asked for (not in Auto); the dots found as blobs, the grid fitted to them: rotated, mirrored and in perspective (camera) |
| Han Xin Code | HAN_XIN | versions 1 to 84, all data modes (numeric, text, binary, the Chinese regions and GB 18030 2- and 4-byte), ECI | only when asked for (not in Auto); with detector: anywhere in the image, rotated, mirrored and in perspective (camera) |
| Format | TBarcodeFormat | Also | Notes |
|---|---|---|---|
| UPC-A | UPC_A | 2 or 5 digit add-on | add-on with the hint ALLOWED_EAN_EXTENSIONS |
| UPC-E | UPC_E | 2 or 5 digit add-on | |
| EAN-8 | EAN_8 | ||
| EAN-13 | EAN_13 | 2 or 5 digit add-on, ISBN (as EAN-13) | |
| Code 39 | CODE_39 | Full ASCII (USE_CODE_39_EXTENDED_MODE), check digit (ASSUME_CODE_39_CHECK_DIGIT) | |
| Code 32 | CODE_32 | Italian pharmacy code; only when asked for (Auto: CODE_39) | |
| PZN | PZN | German Pharmazentralnummer; only when asked for (Auto: CODE_39) | |
| Code 93 | CODE_93 | Full ASCII | |
| Code 128 | CODE_128 | GS1-128 | |
| ITF | ITF | ITF-14 (as ITF), any even length from 6 digits (ALLOWED_LENGTHS) | |
| Codabar | CODABAR | start and stop characters with RETURN_CODABAR_START_END | |
| Telepen | TELEPEN | full ASCII and compressed numeric | |
| GS1 DataBar | RSS_14 | Omnidirectional, Truncated, Stacked, Stacked Omnidirectional | |
| GS1 DataBar Expanded | RSS_EXPANDED | Expanded Stacked | |
| GS1 DataBar Limited | RSS_LIMITED | ||
| DX Film Edge | DX_FILM_EDGE | frame number | |
| MSI | MSI | modulo 10 check digit (ASSUME_MSI_CHECK_DIGIT) | only when asked for |
| Plessey | PLESSEY | CRC checked; only when asked for | |
| Pharmacode | PHARMA_CODE | Laetus one track; only when asked for | |
| Pharmacode two-track | PHARMA_CODE_TWO_TRACK | Laetus two track, horizontal and vertical; at least 3 bars, of at least 2 kinds (bars of one kind do not tell where the other track is); only when asked for | |
| Code 11 | CODE_11 |
Rows of 1D characters, read in Auto with one scan for all of them. Horizontal, also upside down; vertical with TRY_HARDER (like the 1D codes).
| Format | TBarcodeFormat | Notes |
|---|---|---|
| Codablock F | CODABLOCK_F | 2 to 44 rows of Code 128 characters, row numbers, row checksums and K1, K2 checked; in Auto before Code 128 (its rows are Code 128 rows) |
| Code 16K | CODE_16K | 2 to 16 rows of 5 Code 128 characters, the row numbers in the start and stop patterns, 2 check characters (modulo 107); GS1 (FNC1 first: ]K1) |
| Code 49 | CODE_49 | 2 to 8 rows of 4 symbol characters, the row numbers in the parity, row checks and the symbol checks X, Y, Z; alphanumeric, shifts (ASCII) and numeric; GS1 (FNC1 first) |
In Auto, or asked for as GS1_COMPOSITE (then only composites).
| Format | TBarcodeFormat | Notes |
|---|---|---|
| GS1 Composite | GS1_COMPOSITE | the 2D component CC-A, CC-B (MicroPDF417) or CC-C (PDF417, with GS1-128) above an EAN-13, EAN-8, UPC-A, UPC-E, GS1 DataBar (Omnidirectional, Limited, Expanded) or GS1-128; also upside down; text: the linear text, ' |
Only when asked for, not in Auto. The ones of bars that differ in height (4-state, and POSTNET, PLANET and CEPNet): horizontal and vertical, upside down, slanted and in perspective.
| Format | TBarcodeFormat | Notes |
|---|---|---|
| KIX (PostNL) | KIX | starting with a Dutch postcode (it has no start or stop: that tells the direction) |
| RM4SCC (Royal Mail 4-State Customer Code) | RM4SCC | check character checked, not in the text |
| USPS Intelligent Mail Barcode | IMB | CRC checked; text: tracking code (20 digits) and routing code (ZIP, 0, 5, 9 or 11 digits) |
| POSTNET (USPS) | POSTNET | 5, 9 or 11 digits, check digit checked, not in the text |
| PLANET (USPS) | PLANET | 11 or 13 digits, check digit checked, not in the text |
| Japan Post (Kasutama) | JAPAN_POST | postal code and address (with letters), check character checked |
| Australia Post 4-State Customer Barcode | AUSTRALIA_POST | Standard, Customer Barcode 2 and 3, reply, routing and redirection; Reed-Solomon (errors corrected); text: format control code, DPID and customer information |
| Royal Mail Mailmark 4-state (barcode C and L) | MAILMARK_4STATE | Reed-Solomon (errors corrected); text: format, version, class, supply chain ID, item ID and destination postcode plus DPS, as zint |
| CEPNet (Correios, Brazil) | CEPNET | POSTNET of 8 digits (CEP), check digit checked, not in the text |
| Korea Post | KOREA_POST | postal code of 6 digits and the check digit (checked; as printed below the bars); read as a 1D code |
| USPS FIM (Facing Identification Mark) | FIM | A to E; no check: tall straight bars (at least 10 times their width) in a clear zone, horizontal and vertical |
| Deutsche Post Leitcode | DP_LEITCODE | ITF of 14 digits, check digit (weights 4 and 9) checked, in the text; Auto: ITF |
| Deutsche Post Identcode | DP_IDENTCODE | ITF of 12 digits, check digit (weights 4 and 9) checked, in the text; Auto: ITF |
Let me know !
4.0.0
v3.12.0
v3.11.0
v3.10.1
v3.10.0 Improvements by René Hoffmann. https://github.com/Spelt/ZXing.Delphi/issues/143
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 , pull requests with code optimization from EguitarRed and Rene Pastoors.
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!
Did I miss anyone? 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
| 1 or 2 check digits (C, K) |
| check digit(s) checked, in the text; only when asked for |
| Industrial 2 of 5 | INDUSTRIAL_2_OF_5 | check digit in the text | only when asked for |
| IATA 2 of 5 | IATA_2_OF_5 | check digit in the text | only when asked for |
| Matrix 2 of 5 | MATRIX_2_OF_5 | check digit in the text | also called Standard 2 of 5; only when asked for |
| Datalogic 2 of 5 | DATALOGIC_2_OF_5 | check digit in the text | only when asked for |
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