FR VCL 4 Pro Load Image from Stream
HI,
Have searched the forum(s) for code and the documentation that shows how to do this. Nothing dound in the pdf documentation. On the forums there have been no replies to questions asking how to do this. There a a few replies that show loadfromfile as a solution, which does not answer the original question 1. Using the Picture component OnBerforePrint Event
a.Loading from file I can do OK.
b. Loading from a stream is a problem.
Using the code completion I can see the LoadFromFile and LoadFromStream functions.
LoadFromFile Works easily as I can give it a string and it just works.
LoadFromStream is a problem as I don't know where or how to place the Stream variable so it is accessable to the script code.
Is it possible to LoadFromStream from a TfrxPictureView OnBeforePrint Event?
For anyone looking for some form of loadfromstream for Pictures the following code works, although not event driven.
Have searched the forum(s) for code and the documentation that shows how to do this. Nothing dound in the pdf documentation. On the forums there have been no replies to questions asking how to do this. There a a few replies that show loadfromfile as a solution, which does not answer the original question 1. Using the Picture component OnBerforePrint Event
a.Loading from file I can do OK.
b. Loading from a stream is a problem.
Using the code completion I can see the LoadFromFile and LoadFromStream functions.
LoadFromFile Works easily as I can give it a string and it just works.
LoadFromStream is a problem as I don't know where or how to place the Stream variable so it is accessable to the script code.
Is it possible to LoadFromStream from a TfrxPictureView OnBeforePrint Event?
For anyone looking for some form of loadfromstream for Pictures the following code works, although not event driven.
.....
Var
S: TFileStream;
PV: TfrxComponent;
begin
PV := frxReport.FindObject('Picture1');
if Assigned (PV)
then
begin
S := TFileStream.Create('C:\Dev\Graphics\Reports\Reports_White.png',fmOpenRead);
try
TfrxPictureView (PV).LoadPictureFromStream(S,true);
frxReport.ShowReport(True);
finally
s. Free;
end;
end;
end;
Comments
I don't know if fastscript can handle this but you can create your custom function (see "custom components development").
Best Regards,
Cristian Peta
and you can also learn how to create image from stream and byte arry. hope it is helpful to you.