Have an amazing solution built in RAD Studio? Let us know. Looking for discounts? Visit our Special Offers page!
DelphiRAD Studio

Delphi向けの強力なエンタープライズグレードのバーコードスキャンライブラリ

enterprise-grade-barcode-scanning-library-for-delphi-ja

ZXing.Delphiライブラリは、Delphi向けの最も人気のあるバーコードスキャンライブラリの1つで、よく知られているオープンソースのバーコードライブラリであるZXingプロジェクト(ZXingは「ゼブラクロッシング」と読みます)をベースとしたネイティブのObjectPascalライブラリです。

このライブラリは、別のプラットホームで既に提供されているZXing.NETやZXing for Javaをベースにしています。もともとFireMonkeyプラットフォームを対象にしておりましたが、v3.1からは、Windows VCLアプリケーションも完全にサポートしています。(FMX.Graphicsユニットに非依存)

ZXing.Delphiライブラリを使用すれば、外部ライブラリとのリンクを必要とせずにネイティブの速度で高速にスキャンでき、互換性や依存関係などの諸問題も回避できます。

procedure TmainFrm.btnLoadFromFileClick(Sender: TObject);
var  ReadResult: TReadResult;
     ScanManager: TScanManager;
     bmp:VCL.Graphics.TBitmap; // just to be sure we are really using VCL bitmaps
begin
  if not OpenDlg.Execute then exit;
  image.Picture.LoadFromFile(openDlg.FileName);
  ReadResult := nil;
  ScanManager := nil;
  bmp := nil;
  try
    bmp:= TBitmap.Create;
 
    bmp.assign (image.Picture.Graphic);
    ScanManager := TScanManager.Create(TBarcodeFormat.Auto, nil);
    ReadResult := ScanManager.Scan(bmp);
    if ReadResultnil then
      log.Lines.Text := ReadResult.text
    else
      log.Lines.Text := 'Unreadable!';
  finally
  	bmp.Free;
    ScanManager.Free;
    ReadResult.Free;
  end;
end;

ZXing.Delphiライブラリの特徴

  • すべてのVCLおよびFireMonkeyプラットフォーム(iOS/Android/Windows/macOS)向けにネイティブにコンパイルされたバーコードスキャン
  • ライセンスフリー(無償利用可)
  • ネイティブ速度による高速スキャン
  • シンプルなAPI
  • ユニットテストの提供
  • テストプロジェクトの提供

ZXing.Delphiライブラリは、無償で利用可能なオープンソースですが、Apacheライセンスが規定されています。ZXing.Delphiの全てのライブラリとサンプルコードは、GitHub経由でこちらから入手できます。なお、エンバカデロではこのライブラリに関するテクニカルサポートサービスは提供しておりません。

Kai for RAD Studio is Now Available! Special Live Webinar: Introducing Kai - A New Chapter for RAD Studio RAD Studio 13.1 Florence Now Available

Reduce development time and get to market faster with RAD Studio, Delphi, or C++Builder.
Design. Code. Compile. Deploy.

Start Free Trial   Upgrade Today

   Free Delphi Community Edition   Free C++Builder Community Edition

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

IN THE ARTICLES