Event: OnEncode

(TBarcode1D_Code128, TBarcode1D_EAN128)

For the TBarcode1D_Code128 and TBarcode1D_EAB128 components, occurs when the value of Barcode property is changed and the component is updating its barcode symbol, or one of the Clear, Draw, Size, DrawTo, DrawToSize, Print, PrintSize method is called.

The TBarcode1D_Code128 and TBarcode1D_EAB128 components can be used to encode any character, by default, the ANSI encoding scheme is used. The event is useful if you want to encode the barcode text in your own encoding scheme before generate the barcode symbol. See also the "How to encode the UNICODE text in a Code128/EAN128 symbol" article.



{ Defined in the pCode128 unit }

TOnEncode = procedure (Sender: TObject; var Data: AnsiString; Barcode: string) of object;

property OnEncode: TOnEncode;


The event doesn't occur when the DrawTo (syntax 3), DrawToSize (syntax 3), Print (syntax 3), or PrintSize (syntax 3) method is called.