Barcode
TsgcHTMLComponent_Barcode — Delphi、C++ Builder、.NET で、任意の ASCII テキストから、任意の可読キャプションを備えた純粋な Pascal 実装の Code 128 SVG バーコードをレンダリングします。
TsgcHTMLComponent_Barcode — Delphi、C++ Builder、.NET で、任意の ASCII テキストから、任意の可読キャプションを備えた純粋な Pascal 実装の Code 128 SVG バーコードをレンダリングします。
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
最もよく使うメンバーです。
Data はエンコードする値です。ASCII 0–127 のみが受け付けられます(範囲外の文字は例外を発生させます)。
Symbology はバーコード規格を選択します。現時点では Code 128(bsCode128)が提供されており、最もコンパクトなエンコードのためにサブセット A/B/C を自動的に切り替えます。
ModuleWidth は最も細いバーのピクセル幅を設定し、Height はバーの高さを設定します。
ShowText は、エンコードされた Data をバーの下に表示します。
Color はバーとテキストを塗り、BackgroundColor はその背景を塗りつぶします。
GetSVG(HTML でも使用されます)は、sgc-barcode コンテナでラップされたインライン SVG マークアップを返します。