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 TsctImageLabel control in order to accommodate entire barcode symbol, then use the DrawTo method of the TBarcode component to draw the barcode symbol to the TsctImageLabel control.
For example:
Barcode_Code391.Barcode := '1235678';
Barcode_Code391.Module := 2;
......
with SctImageLabel1.Picture.Bitmap do
begin
Width := Barcode_Code391.DefaultDisplayWidth(2);
Height := 100;
Barcode_Code391.DrawTo(Canvas, 2, 0, 0, 100, 0, 0);
end;