Barcode コンポーネント — sgcHTML | eSeGeCe

Barcode

TsgcHTMLComponent_Barcode — Delphi、C++ Builder、.NET で、任意の ASCII テキストから、任意の可読キャプションを備えた純粋な Pascal 実装の Code 128 SVG バーコードをレンダリングします。

TsgcHTMLComponent_Barcode

Data(および任意で Symbology)を設定してから、HTML プロパティを読み取ります。

コンポーネントクラス

TsgcHTMLComponent_Barcode

レンダリング内容

インライン SVG Code 128 バーコード + 任意のテキスト(純粋な Pascal 実装のエンコーダー)

ファミリー

チャート & 可視化

言語

Delphi, C++ Builder, .NET

ペイロードを設定し、レンダリングする

Data を設定し、ModuleWidth/Height を選択してから、HTML を読み取ります。

uses
  sgcHTML_Component_Barcode;

var
  oBarcode: TsgcHTMLComponent_Barcode;
begin
  oBarcode := TsgcHTMLComponent_Barcode.Create(nil);
  try
    oBarcode.Data := 'ACME-00219841';
    oBarcode.Symbology := bsCode128;
    oBarcode.ModuleWidth := 2;
    oBarcode.Height := 60;
    oBarcode.ShowText := True;

    WebModule.Response := oBarcode.HTML;   // SVG bars + human-readable text
  finally
    oBarcode.Free;
  end;
end;
// includes: sgcHTML_Component_Barcode.hpp

TsgcHTMLComponent_Barcode *oBarcode = new TsgcHTMLComponent_Barcode(NULL);
try
{
  oBarcode->Data = "ACME-00219841";
  oBarcode->Symbology = bsCode128;
  oBarcode->ModuleWidth = 2;
  oBarcode->Height = 60;
  oBarcode->ShowText = true;

  String html = oBarcode->HTML;   // SVG bars + human-readable text
}
__finally
{
  delete oBarcode;
}
using esegece.sgcWebSockets;

var barcode = new TsgcHTMLComponent_Barcode();
barcode.Data = "ACME-00219841";
barcode.Symbology = TsgcHTMLBarcodeSymbology.bsCode128;
barcode.ModuleWidth = 2;
barcode.Height = 60;
barcode.ShowText = true;

string html = barcode.HTML;   // SVG bars + human-readable text

主なプロパティとメソッド

最もよく使うメンバーです。

Payload

Data はエンコードする値です。ASCII 0–127 のみが受け付けられます(範囲外の文字は例外を発生させます)。

Symbology

Symbology はバーコード規格を選択します。現時点では Code 128(bsCode128)が提供されており、最もコンパクトなエンコードのためにサブセット A/B/C を自動的に切り替えます。

Bar sizing

ModuleWidth は最も細いバーのピクセル幅を設定し、Height はバーの高さを設定します。

Human-readable text

ShowText は、エンコードされた Data をバーの下に表示します。

Colours

Color はバーとテキストを塗り、BackgroundColor はその背景を塗りつぶします。

Rendering

GetSVGHTML でも使用されます)は、sgc-barcode コンテナでラップされたインライン SVG マークアップを返します。

さらに詳しく

オンラインヘルプこのコンポーネントの完全な API リファレンスと使用ガイドです。
すべての sgcHTML コンポーネント80 以上のコンポーネントの全機能マトリックスを閲覧できます。
無料体験版のダウンロード30 日間の体験版には 60.HTML デモプロジェクトが付属します。
価格完全なソースコード付きの Single、Team、Site ライセンス。

始める準備はできましたか?

無料体験版をダウンロードして、Delphi、C++ Builder、.NET でバーコードの生成を始めましょう。