FrPicture load with Data from Value
Hello,
I am using Fr2.51
and I want to put the PictureData from a Value,
and in OnGetValue-Event I want to load
the the Value (Variant) from a TMemoryStream.(Bmp)
.... OnGetValue(..)
begin
if ParName = 'PIC1' then
begin
ParValue := ?
end;
(can I uses a String, which I load with the Picture-Data?)
(SetLength(AStr,MyMemStream.Size);
MemStream.ReadBuffer(AStr,MemStream.Size);
or may I use Dynamic Arrays?
)
regards
Ibego
(When I use a Blobfield it works fine, but in this case I cant use a Table)
I am using Fr2.51
and I want to put the PictureData from a Value,
and in OnGetValue-Event I want to load
the the Value (Variant) from a TMemoryStream.(Bmp)
.... OnGetValue(..)
begin
if ParName = 'PIC1' then
begin
ParValue := ?
end;
(can I uses a String, which I load with the Picture-Data?)
(SetLength(AStr,MyMemStream.Size);
MemStream.ReadBuffer(AStr,MemStream.Size);
or may I use Dynamic Arrays?
)
regards
Ibego
(When I use a Blobfield it works fine, but in this case I cant use a Table)
Comments
procedure TForm1.RBeforePrint(Memo: TStringList; View: TfrView);
Var JPeg:TJpegImage;
Bm:TBitmap;
Pv:TFRPictureView;
begin
If View.Name='Picture1' then
Begin
JPeg:=TJPEGImage.Create;
JPeg.LoadFromFile('c:\1.jpg');
Bm:=TBitmap.Create;
Bm.Assign(JPeg);
TFRPictureView(View).Picture.Bitmap.Assign(Bm);
Bm.Free;
JPeg.Free;
End;
end;
Of course if You use native bitmaps the steps behind the loading and the final assigning can be missed or You can use the TFRPictureView(View).Picture.LoadFromFile LoadFromStream as mentioned above.
I hope this helps.
Regards:Alex
Is it only in the BeforePrint-Event possible to assign a Picture?
I would prefer OnGetValue, because I can change the Report at Runtime,
When I use BeforePrint then I need to Know the Name of the FrView-Object,
and I cannot insert two more in the Report.
When I have a Variable which is filled in OnGetValue then I can decide in the Report how much I show the Picture.
bestregards
Ibego
"When I use BeforePrint then I need to Know the Name of the FrView-Object,
and I cannot insert two more in the Report.", only when working externally.
Try working from the script of the pictureview objects memo to do your actual loading or assigning, and you may want to write an on userfunction handler(s) for the report to pass out up to 3 params and return 1 result value, there is a lot of possible combinations you can work out.
regards
this is a good idea! I will try it.
regards
Ibego