Hello
I am trying to generate a barcode with Lazbarcode (3of9).
As I am saving this to a database I don't need to see the barcode element on the form.
So I have put it on a PageControl and I will hide it.
About the problem:
If the barcode is not visible, only the "half" barcode is shown in the picture.
Can someone explain to me what is going on here?
How can I work around this?
(see attamchents, Lazarus 3.6, FPC 3.2.2, x86_64-win64)
procedure TformMain.btnGenerateClick(Sender: TObject);
var
R: TRect;
begin
barcode.Text:= RandomRange(1111111111,9999999999).ToString;
barcode.AutoSize:= true;
barcode.AdjustSize;
barcode.Generate;
FreeAndNil(barcodeImage);
barcodeImage := TBitmap.Create;
R := Rect(0,0,barcode.Width,barcode.Height);
barcodeImage.SetSize(barcode.Width,barcode.Height);
barcodeImage.Canvas.Brush.Color:= clWhite;
barcodeImage.Canvas.FillRect(R);
barcode.PaintOnCanvas(barcodeImage.Canvas, R);
bgImage.Picture.Assign(barcodeImage);
end;
Regards Int3g3r