H
hj6
Unregistered / Unconfirmed
GUEST, unregistred user!
我想在FastReport中动态的载入一幅图片,所以写了如下代码:
procedure TForm1.Button1Click(Sender: TObject);
var
//tempStream:TStringStream;
page:TfrPage;
b :TfrPictureView;
begin
frReport1.Pages.Clear;
frReport1.Pages.Add;
Page := frReport1.Pages[0];
b := TfrPictureView(frCreateObject(gtPicture, ''));
b.SetBounds(20,20,400,400);//一定要指定图象的显示位置及大小,否则没有图象显示。
b.BlobType:=1;
//图象的显示类型为JPG
b.Picture.LoadFromFile('c:/1.jpg');
//tempStream:=TStringStream.Create('');
//b.LoadFromStream(tempStream);
Page.Objects.Add(b);
frReport1.ShowReport;
end;
用LoadFromFile可以实现,但是现在要求用TStringStream来实现,也就是我用//注释的几
句,不知该如何写,请大家指教。谢谢!!!
procedure TForm1.Button1Click(Sender: TObject);
var
//tempStream:TStringStream;
page:TfrPage;
b :TfrPictureView;
begin
frReport1.Pages.Clear;
frReport1.Pages.Add;
Page := frReport1.Pages[0];
b := TfrPictureView(frCreateObject(gtPicture, ''));
b.SetBounds(20,20,400,400);//一定要指定图象的显示位置及大小,否则没有图象显示。
b.BlobType:=1;
//图象的显示类型为JPG
b.Picture.LoadFromFile('c:/1.jpg');
//tempStream:=TStringStream.Create('');
//b.LoadFromStream(tempStream);
Page.Objects.Add(b);
frReport1.ShowReport;
end;
用LoadFromFile可以实现,但是现在要求用TStringStream来实现,也就是我用//注释的几
句,不知该如何写,请大家指教。谢谢!!!