To show bitmap created in memory in Rave
I have created a bitmap in memory, and would like to show this in rave report design开发者_JAVA技巧 time. I don't want to create a file then load. Is there a better way?
Thanks and regards, jai
Here is a code snippet I wrote for a school project some time ago. I think I put quite some research in it then and couldn't find another way.... I think the code is clear enough to see how I did it: use the clipboard. cMohr is a TChart component.
I don't have Delphi installed here right now, so I can't test it but it should work!
with Sender as TBaseReport do
begin
SetFont('Arial', 15);
Title := 'JTester results';
PrintHeader('JTester results', pjCenter);
// Mohr Circle
bmp := TBitmap.Create;
cMohr.Color := clWhite;
cMohr.CopyToClipboardBitmap;
cMohr.Color := clBtnFace;
bmp.LoadFromClipboardFormat(cf_BitMap,ClipBoard.GetAsHandle(cf_Bitmap),0);
PrintBitmapRect(0.2,0.5,PageWidth-0.4,(PageWidth-0.4)*bmp.Height/bmp.Width,bmp);
..
..
You could use a LoadFromStream into a TBitmap and then use that bitmap in RAVE.
精彩评论