Also, put a TDBBarcode1D component to the form and link the TBarcode1D component to the TDBBarcode1D component if the database support is required.
In the event function, change the properties of the TBarcode1D component such as Barcode, Module, and Ratio, and adjust the bitmap size of the TsctImageLabel control in order to accommodate entire barcode symbol, then use the DrawTo method of the TBarcode1D component to draw the barcode symbol to the TsctImageLabel control.
For example:
var
BarcodeWidth, BarcodeHeight, SymbolWidth, SymbolHeight: Integer;
begin
......
Barcode1D_Code391.Barcode := '1235678';
Barcode1D_Code391.Module := 2;
......
with SctImageLabel1.Picture.Bitmap do
begin
Barcode1D_Code391.DrawToSize(BarcodeWidth, BarcodeHeight, SymbolWidth, SymbolHeight, Canvas);
Width := BarcodeWidth;
Height := 100;
Barcode1D_Code391.DrawTo(Canvas, 0, 0);
end;