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 마크업을 반환합니다.