Also, put a TDBBarcode component to the form and link the TBarcode component to the TDBBarcode component if the database support is required.
In the event function, change the properties of the TBarcode component such as Barcode, Module, and Ratio, and adjust the bitmap size of the TppImage control in order to accommodate entire barcode symbol, then use the DrawTo method of the TBarcode component to draw the barcode symbol to the TppImage control.
For example:
Barcode_Code391.Barcode := '1235678';
Barcode_Code391.Module := 2;
......
ppReport1Image1.Picture.Bitmap.Width := Barcode_Code391.DefaultDisplayWidth(1);
ppReport1Image1.Picture.Bitmap.Height := 100;
Barcode_Code391.DrawTo(ppReport1Image1.Picture.Bitmap.Canvas, 1, 0, 0, 100, 0, 0, 0);