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, GetParity (only TBarcode2D_QRCode), GetCheckSum (only TBarcode2D_PDF417), GetCheckSum (only TBarcode2D_MicroPDF417) method is called.
It's 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 2D barcode symbol" article.
type
{ Defined in the pCore2D unit }
TOnEncode = procedure (Sender: TObject; var Data: AnsiString; Barcode: string) of object;
property OnEncode: TOnEncode;
The initial value is the barcode text in AnsiString (the barcode text will be converted to AnsiSring if the UNICODE string is supported by the Delphi or C++ Builder). By default, it's in ANSI encoding scheme.
Its value is equal to the Barcode property if the Clear, Draw, Size, DrawTo (syntax 1), DrawToSize (syntax 1), Print (syntax 1), or PrintSize (syntax 1) method is called or a component is updating its barcode symbol. And the value of the parameter is equal to the Barcode parameter if the DrawTo (syntax 2), DrawToSize (syntax 2), Print (syntax 2), PrintSize (syntax 2), GetParity (syntax 1) (only TBarcode2D_QRCode), GetCheckSum (syntax 1) (only TBarcode2D_PDF417), or GetCheckSum (syntax 1) (only TBarcode2D_MicroPDF417) method is called.
The event doesn't occur when the DrawTo (syntax 3), DrawToSize (syntax 3), Print (syntax 3), PrintSize (syntax 3), GetParity (syntax 2) (only TBarcode2D_QRCode), GetCheckSum (syntax 2) (only TBarcode2D_PDF417), or GetCheckSum (syntax 2) (only TBarcode2D_MicroPDF417) method is called.