BackPicture.Bitmap
I have this and works find, but I think I have memory leak
var
theFirspage : TfrxReportPage;
begin
theFirspage := TfrxReportPage(myreport.Pages[1]);
theFirspage.BackPicture.Bitmap:=TBitmap.create;
theFirspage.BackPicture.Bitmap.Width :=400;
theFirspage.BackPicture.Bitmap.height :=400;
theFirspage.BackPicture.Bitmap.canvas.Font.Color := clred;
theFirspage.BackPicture.Bitmap.canvas.Font.Size := 32;
theFirspage.BackPicture.Bitmap.Canvas.Font.Style := [fsBold];
theFirspage.BackPicture.Bitmap.canvas.TextOut(60, 80, ???WECOME???);
end;
my question is: which part I need to free to avoid memory leak?
I tried theFirspage.BackPicture.Bitmap.free
but I got error. or no need to free anything at this point
Thank you
var
theFirspage : TfrxReportPage;
begin
theFirspage := TfrxReportPage(myreport.Pages[1]);
theFirspage.BackPicture.Bitmap:=TBitmap.create;
theFirspage.BackPicture.Bitmap.Width :=400;
theFirspage.BackPicture.Bitmap.height :=400;
theFirspage.BackPicture.Bitmap.canvas.Font.Color := clred;
theFirspage.BackPicture.Bitmap.canvas.Font.Size := 32;
theFirspage.BackPicture.Bitmap.Canvas.Font.Style := [fsBold];
theFirspage.BackPicture.Bitmap.canvas.TextOut(60, 80, ???WECOME???);
end;
my question is: which part I need to free to avoid memory leak?
I tried theFirspage.BackPicture.Bitmap.free
but I got error. or no need to free anything at this point
Thank you
Comments
you can't create the bitmap inside the report and you can't set size font or font colors.
var
theFirspage : TfrxReportPage;
MyBMP: TBitmap;
begin
theFirspage := TfrxReportPage(myreport.Pages[1]);
MyBMP:=TBitmap.create;
theFirspage.BackPicture.Bitmap:=MyBmp;
Then AFTER you are finished with the report (after .Show), would call MyBmp.free;
I???m doing the code just after load the report from the report
Please explain why not?
help me.