Hi,
I am using Lazreport plus Laz-Barcodes.
I have a TBarcodeQR on my form, and a procedure like this :
procedure TForm1.frReport1EnterRect(Memo: TStringList; View: TfrView);
var
tmp : TBitmap;
w,h : integer;
r : TRect;
begin
if (View.Name='Picture1') then
begin
BarCodeQR1.Text := Edit1.Text;
BarCodeQR1.Update;
w := BarCodeQR1.Width;
h:= BarCodeQR1.Height;
r:= Rect(0,0,w,h);
tmp:=TBitmap.Create;
tmp.Width:=w;
tmp.Height:=h;
tmp.Canvas.CopyRect(r, BarCodeQR1.Canvas, r);
TFrPictureView(View).Picture.Bitmap.Assign(tmp);
tmp.free;
end;
end;
procedure TForm1.MyPrintingProcedure;
begin
frReport1.LoadFromFile('REPORTO_qrprint1.lrf');
frVariables['teksto']:=edit1.Text;
frreport1.ShowReport;
end;
And all works good, in my lazreport QR codes are shown correctly, as expected.
But, a problem appears when I call from another form :
procedure TThisIsAnotherForm.CallToPrint;
begin
Form1.MyPrintingProcedure;
end;
in this case instead of the QR code i am getting black box.
It behaves like i have to show the form with the TBarcodeQR ?!
I dont want to show the printing form, I just want to call it.